title: Display XML results in HTML table
body: <p>I need to display the XML data from this URL: <a href="http://api.redfoundry.com/RFBase.ashx?type=get&amp;name=b39d11d5-505f-453e-bcfc-9d3b19dd8a61&amp;key=2469F6F56F61976FB51FDEC878E93555" rel="nofollow">http://api.redfoundry.com/RFBase.ashx?type=get&amp;name=b39d11d5-505f-453e-bcfc-9d3b19dd8a61&amp;key=2469F6F56F61976FB51FDEC878E93555</a></p>
  
  <p>into a HTML table that will automatically load when the HTML page is visited.</p>
  
  <p>So far I have got the following but it doesn't seem to work, it's come from a W3 tutorial:</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;script&gt;
              if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari   
                  xmlhttp = new XMLHttpRequest();
              }
              else {// code for IE6, IE5
                  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
              }
              xmlhttp.open("GET","http://api.redfoundry.com/RFBase.ashx?type=get&amp;name=b39d11d5-505f-453e-bcfc-9d3b19dd8a61&amp;key=2469F6F56F61976FB51FDEC878E93555",false);
              xmlhttp.send();
              xmlDoc = xmlhttp.responseXML; 
              document.write("&lt;table border='1'&gt;");
              var x = xmlDoc.getElementsByTagName("item");
              for (var i=0; i&lt;x.length; i++) { 
                  document.write("&lt;tr&gt;&lt;td&gt;");
                  document.write(x[i].getElementsByTagName("placename")[0].childNodes[0].nodeValue);
                  document.write("&lt;/td&gt;&lt;td&gt;");
                  document.write(x[i].getElementsByTagName("description")[0].childNodes[0].nodeValue);
                  document.write("&lt;/td&gt;&lt;/tr&gt;");
              }
              document.write("&lt;/table&gt;");
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The results that I want to show in the table are 'Item ID', placename, description, and address.</p>