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