Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <script src="loadxmldoc.js"> </script> </head> <body> <script> xmlDoc=loadXMLDoc("books.xml"); x=xmlDoc.getElementsByTagName('book'); document.write(x.item(0).attributes[0].ownerDocument); document.write("<br>"); document.write(x.item(0).attributes[0].ownerDocument.nodeName); document.write("<br>"); document.write(x.item(0).attributes[0].ownerDocument.nodeType); </script> </body> </html>
Result:
W3Schools.com - Try it yourself