title: 'getElementsByTagName' comes up undefined
body: <p>I am working on a content flow that displays images based on xml content.
  I'm building it as a site, so it's html and javascript, and for some unknown reason-and believe me I've combed it over with as fine of a toothed comb as I can- my javascript just isn't loading my xml (thats what I'm fairly certain the problem is, but I could be wrong) and it's throwing me the error that 'getElementsByTagName' is null. Now currently i havent built in the full functionality, I just wanted to test the xml by having it read out as text so bear with me here. </p>
  
  <p>loadXMLDoc.js:</p>
  
  <pre><code>function loadXMLDoc(filename)
  {
  if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
  else // code for IE5 and IE6
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xhttp.open("GET",filename,false);
  xhttp.send();
  return xhttp.responseXML;
  }
  </code></pre>
  
  <p>my internal java in the html:</p>
  
  <pre><code>&lt;script&gt;
  xmlDoc = loadXMLDoc("test.xml");
      var x = xmlDoc.getElementsByTagName("song");
      for (i=0; i&lt;x.length; i++);
      {
       var a = (x[i].getElementsByTagName("source")[0].childnodes[0].nodeValue);
       var b = (x[i].getElementsByTagName("artist")[0].childnodes[0].nodeValue);
       var c = (x[i].getelementsByTagName("title")[0].childnodes[0].nodeValue);
       var par = '&lt;img class= "item" href ="#" ondblclick = "confirm()" src ="' +'" "title="' +b+ '"-"'+ c+ ' " /&gt;';
       document.getElementById("demo").innerHTML += par;
       }
  &lt;/script&gt;
  </code></pre>
  
  <p>and the full error:</p>
  
  <p>Uncaught TypeError: Cannot read property 'getElementsByTagName' of undefined album.html:24
  (anonymous function)</p>
  
  <p>and for funsies my xml sample:</p>
  
  <pre><code>&lt;song&gt;
  &lt;source&gt;imgs/Beck.jpg&lt;/source&gt;
  &lt;title&gt;Modern Guilt&lt;/title&gt;
  &lt;artist&gt;Beck&lt;/artist&gt;
  &lt;/song&gt;
  </code></pre>
  
  <p>Hopefully I covered all that would be needed, I know its probably something silly, but I can't nail it down. </p>