En Javascript encontré esta clase, q quizas os pueda ser util.
Código PHP:
function XMLUtil()
{
this.UNINITIALIZED = 0;
this.LOADING = 1;
this.LOADED = 2;
this.INTERACTIVE = 3;
this.COMPLETE = 4;
this.isIE = (document.implementation.createDocument) ? false : true;
}
XMLUtil.prototype.getXMLHTTPObject = function()
{
if(this.isIE)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
return new XMLHttpRequest();
}
}
XMLUtil.prototype.getDOM = function()
{
if (this.isIE)
{
return new ActiveXObject("Microsoft.XMLDOM");
}
else
{
return new DOMParser();
}
}
XMLUtil.prototype.getDOMFromString = function(xmlStr)
{
var xmlDom = this.getDOM();
if (this.isIE)
{
xmlDom.async = 'false';
xmlDom.loadXML(xmlStr);
return xmlDom;
}
else
{
return xmlDom.parseFromString(xmlStr, 'text/xml');
}
}
XMLUtil.prototype.getText = function(elem)
{
if (this.isIE)
{
return elem.text;
}
else
{
return elem.textContent;
}
}
function replaceHTML(idName, content)
{
var target = document.getElementById(idName);
target.innerHTML = content;
}
function BrowserDetection()
{
var isIE, isMozilla, isSafari, isOpera = false;
if (navigator.userAgent.indexOf('MSIE') != -1)
this.isIE = true;
else if (navigator.userAgent.indexOf('Safari') != -1)
this.isSafari = true;
else if (navigator.userAgent.indexOf('Opera') != -1)
this.isOpera = true;
else
this.isMozilla = true;
}