<!DOCTYPE html>src="/statics/demosource/loadxmldoc.js"//check if the first node is an element nodefunction get_firstChild(n){y=n.firstChild;while (y.nodeType!=1){y=y.nextSibling;}return y;}xmlDoc=loadXMLDoc("/statics/demosource/books.xml");x=get_firstChild(xmlDoc.getElementsByTagName("book")[0]);document.write(x.nodeName);