function loadXMLDoc(dname)
if (window.XMLHttpRequest)
xhttp=new XMLHttpRequest();
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
xhttp.open("GET",dname,false);
return xhttp.responseXML;
xml=loadXMLDoc("/statics/demosource/books.xml");
path="/bookstore/book/price/text()"
if (window.ActiveXObject)
var nodes=xml.selectNodes(path);
for (i=0;i<nodes.length;i++)
document.write(nodes[i].nodeValue);
else if (document.implementation && document.implementation.createDocument)
var nodes=xml.evaluate(path, xml, null, XPathResult.ANY_TYPE,null);
var result=nodes.iterateNext();
document.write(result.nodeValue + "<br>");
result=nodes.iterateNext();