title: how to get name of a xml tag with js ajax
body: <p>I have an xml file i am ripping apart with ajax:</p>
  
  <pre><code>&lt;country name="UK"&gt;
          &lt;person&gt;
              &lt;name&gt;daniel&lt;/name&gt;
              &lt;age&gt;25&lt;/city&gt;
          &lt;/person&gt;
          &lt;person&gt;
              &lt;name&gt;james&lt;/name&gt;
              &lt;age&gt;22&lt;/city&gt;
          &lt;/person&gt;
          &lt;person&gt;
              &lt;name&gt;brandy&lt;/name&gt;
              &lt;age&gt;16&lt;/city&gt;
          &lt;/person&gt;
          &lt;person&gt;
              &lt;name&gt;nathan&lt;/name&gt;
              &lt;age&gt;66&lt;/city&gt;
          &lt;/person&gt;
      &lt;/country&gt;
      &lt;country name="france"&gt;
          &lt;person&gt;
              &lt;name&gt;paul&lt;/name&gt;
              &lt;age&gt;28&lt;/city&gt;
          &lt;/person&gt;
          &lt;person&gt;
              &lt;name&gt;pierr&lt;/name&gt;
              &lt;age&gt;22&lt;/city&gt;
          &lt;/person&gt;
      &lt;/country&gt;
  </code></pre>
  
  <p>Any my JS look like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function loadXMLDoc() {
  xmlhttp=null;
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=function() 
  {
      if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
            {
            xmlDoc=xmlhttp.responseXML;
            var txt="";
            x=xmlDoc.getElementsByTagName("name");
            for (i=0;i&lt;x.length;i++)
              {
              txt=txt + x[i].childNodes[0].nodeValue + "&lt;br /&gt;";
              }
            document.getElementById("myDivName").innerHTML=txt;
            //somehow get the country of that person to write here
            document.getElementById("myDivCountry").innerHTML=txt;
  
            }
        xmlhttp.open("GET","people.xml",true);
        xmlhttp.send();
        }
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>The JS will print the name of the person, but how to i get the name of the country that person belongs to?</p>
  
  <p>this is all example content written for this problem... i didn't right the xml - it's a feed from another location i want to filter</p>
  
  <p>thanks</p>
  
  <p>dan</p>