window.onload = function(){
var text = 'StackOverFlow';
var parser = null;
if (window.DOMParser){
parser = new DOMParser();
xmlDoc = parser.parseFromString(text,"text/xml");
} else{ // Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(text);
}
var a = xmlDoc.childNodes[0];
alert(a.childNodes[0].nodeValue);
}
http://www.w3schools.com/dom/dom_parser.asp