title: Parse XML file into a table
body: <p>This is the XML file that needs to be parsed, we will call it "servers.xml".
  This file is on the same server I want it parsed (xml file in same folder).</p>
  
  <pre><code>&lt;root&gt;
      &lt;list&gt;
          &lt;server&gt;
              &lt;server name="28 Disconnects Later"&gt;
                  &lt;timestamp name="2015-02-25 14:28:56"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 14:58:56"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 15:28:57"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 15:58:58"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 16:28:59"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 16:59:00"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 17:29:01"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 17:59:02"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 18:29:04"&gt;low&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 18:59:05"&gt;low&lt;/timestamp&gt;
              &lt;/server&gt;
              &lt;server name="Abomination"&gt;
                  &lt;timestamp name="2015-02-25 14:28:56"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 14:58:56"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 15:28:57"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 15:58:58"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 16:28:59"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 16:59:00"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 17:29:01"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 17:59:02"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 18:29:04"&gt;high&lt;/timestamp&gt;
                  &lt;timestamp name="2015-02-25 18:59:05"&gt;high&lt;/timestamp&gt;
              &lt;/server&gt;
          &lt;/server&gt;
      &lt;/list&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I need to sort it into a table like so:</p>
  
  <pre><code>|----------------------------------|
  | server name                      |
  |----------------------------------|
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  |----------------------------------|
  |                                  |
  |----------------------------------|
  | server name                      |
  |----------------------------------|
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  | timestamp name | timestamp value |
  </code></pre>
  
  <p>I have been working on how todo this for a couple of hours but can't seem to get stuff to display correctly or at all.</p>
  
  <p>Any help is appreciated  </p>
  
  <p>EDIT CURRENT CODE:  </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;style&gt;
          table, th, td {
              border: 1px solid black;
              border-collapse:collapse;
          }
          th, td {
              padding: 5px;
          }
      &lt;/style&gt;
  &lt;/head&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","AOD-H1Z1.xml",false);
      xmlhttp.send();
      xmlDoc=xmlhttp.responseXML;
  
      document.write("&lt;table&gt;&lt;tr&gt;&lt;th colspan='2'&gt;Server&lt;/th&gt;&lt;/tr&gt;");
      var x=xmlDoc.getElementsByTagName("server");
      for (i=0;i&lt;x.length;i++)
      {
          document.write("&lt;tr&gt;&lt;td&gt;");
          document.write(x[i].getElementsByTagName("timestamp")[0].childNodes[0].nodeValue);
          document.write("&lt;/td&gt;&lt;td&gt;");
          document.write(x[i].getElementsByTagName("timestamp")[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>