title: get value from XML File in JavaScript
body: <p>I have an XML File with the following format:</p>
  
  <pre><code>&lt;containers&gt;
      &lt;container&gt;
          &lt;item&gt;
              item name
          &lt;/item&gt;
          &lt;item&gt;
              item name
          &lt;/item&gt;
          &lt;item&gt;
              item name
          &lt;/item&gt;
      &lt;/container&gt;
      &lt;container&gt;
          &lt;item&gt;
              item name
          &lt;/item&gt;
      &lt;/container&gt;
  &lt;/containers&gt;
  </code></pre>
  
  <p>I need to use javascript to get the first item name in the second container. I was going to use <code>xmldoc.getElementsByTagName("item")[3].childNodes[0].nodeValue;</code> but I have no way of knowing how many items will be in the first container, so I'm looking for a way to select the second container then the item's name.</p>