Hi, I am a newbie (ish) to JavaScript. I need to parse an xml file and output the node names, values and attributes. I have the node names and values outputting ok but am having trouble finding what code I should use to output the attributes. Do I use getAttribute or getAttributeNode, any help would be most appreciated. function printTheElement(indent, node) { var i; if (node.nodeType == 3) { document.write("<br />Text Value" +indent + node.nodeValue); } else { document.write("<br />Start Node" +indent + "[" + node.nodeName + "]"); for (i = 0; i < node.childNodes.length; i++) { printTheElement(indent+tab, node.childNodes); } document.write("<br />End Node" +indent + "[/" + node.nodeName + "]"); } } var xmlDoc = new ActiveXObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load("test.xml") printTheElement("", xmlDoc.documentElement);