title: How to parse XML structure with javascript JQuery
body: <p>This is the XML File:     </p>
  
  <pre><code>&lt;Test&gt;
      &lt;Category&gt;
          &lt;SubCat&gt;
              &lt;Name&gt;Name&lt;/Name&gt;
              &lt;Properties&gt;
                  &lt;Key&gt;Key&lt;/Key&gt;
                  &lt;Value&gt;Value&lt;/Value&gt;
              &lt;/Properties&gt;
          &lt;/SubCat&gt;
          &lt;SubCat&gt;
              &lt;Name&gt;Name&lt;/Name&gt;
              &lt;SubCat&gt;
                  &lt;Name&gt;AnotherName&lt;/Name&gt;
                  &lt;Properties&gt;
                      &lt;Key&gt;Key&lt;/Key&gt;
                      &lt;Value&gt;Value&lt;/Value&gt;
                  &lt;/Properties&gt;
              &lt;/SubCat&gt;
          &lt;/SubCat&gt;
      &lt;/Category&gt;
  &lt;/Test&gt;
  </code></pre>
  
  <p>I would like to get the Name. But only the Name of the first SubCat.
  And the properties key value. The problem is the SubCat exist two times.</p>
  
  <p>I tried this:</p>
  
  <pre><code>$(xml).find('SubCat').each(function() {
      var name = $(this).find("Name").text();
      alert(name);
  
  }
  </code></pre>
  
  <p>but this show the name of the first and the second SubCat.</p>
  
  <p>i search for something like this. </p>
  
  <pre><code>rootElement(Category).selectallchildren(SubCat).Name for the first SubCat Name
  rootElement(Category).selectallchildren(SubCat).(SubCat).Name for the second SubCat Name
  </code></pre>
  
  <p>And same explicit select for the Key and values</p>