title: getElementsByTagName not working in IE when returning XML file?
body: <p>I'm trying to select certain elements from an XML file via JavaScript, I've got it working in Firefox, Chrome and IE9+ but IE8 is proving to be a real stumbling block, I'm using the code below to return the XML file:</p>
  
  <pre><code>        function httpGet(theUrl) {
              var xmlHttp = null;
  
              xmlHttp = new XMLHttpRequest();
              xmlHttp.open('GET', theUrl, false);
              xmlHttp.send();
  
              if(window.DOMParser) {
                  var parser = new DOMParser();
                  var doc = parser.parseFromString(xmlHttp.responseText, 'text/xml');
                  return doc;
              }
              else {
                  var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
                  xmlDocument.async = false;
                  xmlDocument.loadXML(xmlHttp.responseText);
                  return xmlDocument;
              }
          }
  </code></pre>
  
  <p>I'm then using the below selectors to make a list of certain items in the XML file:</p>
  
  <pre><code>    var rssData = httpGet(rssFeed);
      var allTitles = convertToArray(rssData.getElementsByTagName('title'));
      var allDates = convertToArray(rssData.getElementsByTagName('pubDate'));
      var allText = convertToArray(rssData.getElementsByTagName('text'));
  </code></pre>
  
  <p>I then concatenate the array items together and set an items <code>innerHTML</code> to that value (I can provide this code if needed)</p>
  
  <p>the strange thing is that IE8 returns the right number of items, but each item has the value <code>undefined</code> as oppsed to the actual value e.g. "Hello world"</p>
  
  <p>I've been battling this for hours and still come up blank ... does anybody have any idea what I'm doing wrong?</p>
  
  <p>EDIT: as requested here is the convert to array function</p>
  
  <pre><code>    function convertToArray(htmlCollection) {
          var nodes = [];
          var collectionLength = htmlCollection.length;
          for(i = 0; i &lt; collectionLength; i++) {
              nodes.push(htmlCollection[i]);
          }
          return nodes;
      }
  </code></pre>