 <p>Note:</p> <ol> <li>Use getElementsByTagName</li> <li>There is no documentList tag in your xml</li> <li><p>Tag document is the only array in your xml not document_list</p> <pre><code>function viewXMLFiles() { console.log("viewXMLFiles() is running"); xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","TestInfo.xml",false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; console.log("still running"); var getData = xmlDoc.getElementsByTagName("document"); console.log("getting tired"); document.getElementById("documentList").innerHTML = getData[0].getElementsByTagName("document_name")[0].childNodes[0].nodeValue; document.getElementById("documentList1").innerHTML = getData[1].getElementsByTagName("document_name")[0].childNodes[0].nodeValue; console.log("done"); } </code></pre></li> </ol> <p>Add one more span with id documentList1 to execute the above code</p>