title: How do I loop through XML nodes in JavaScript?
body: <p>I'm trying to loop through XML nodes containing information about users to create an HTML table on my website.</p>
  <p>This is what the XML looks like:</p>
  <pre><code>&lt;websites_name&gt;
  &lt;user&gt;...&lt;/user&gt;
  &lt;user&gt;...&lt;/user&gt;
  .
  .
  .
  &lt;/websites_name&gt;
  </code></pre>
  <p>And this is the code I'm trying to parse it with:</p>
  <pre><code>for(var user in xmlhttp.getElementsByTagName('user')){   //fix this row to me
      //Create a new row for tbody
      var tr = document.createElement('tr');
      document.getElementById('tbody').appendChild(tr);
  }
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <pre><code>xmlhttp = new XMLHttpRequest();
  xmlhttp.open(&quot;GET&quot;,&quot;some URL&quot;,true);
  xmlhttp.send();
  var xmlDoc = xmlhttp.responseXML;
  var root = xmlDoc.getElementsByTagName('websites_name');
  for(var i=0, i&lt;root[0].childNodes.length,i++){
      //Create a new row for tbody
      var tr = document.createElement('tr');
      document.getElementById('tbody').appendChild(tr);
  }
  </code></pre>