title: Accessing XML node values with JavaScript
body: <p>I have an XML file with the following structure:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;FIELDS&gt;
      &lt;GRP1&gt;
         &lt;OPTION&gt;
              &lt;VALUE&gt;71&lt;/VALUE&gt;
              &lt;CONTENT&gt;Text&lt;/CONTENT&gt;
         &lt;/OPTION&gt;
         ...
         ...
      &lt;/GRP1&gt;
      &lt;GRP2&gt;
         &lt;OPTION&gt;
              &lt;VALUE&gt;77&lt;/VALUE&gt;
              &lt;CONTENT&gt;Test&lt;/CONTENT&gt;
         &lt;/OPTION&gt;
      &lt;/GRP2&gt;
        ...
        ...
  &lt;/FIELDS&gt;
  </code></pre>
  
  <p>I need to get the node values of all child nodes of <code>&lt;OPTIONS&gt;</code> with <code>&lt;GRP1&gt;</code> as parent node.
  I tried the following code but it did not work:</p>
  
  <pre class="lang-js prettyprint-override"><code>// [...]
  var xmlGRP = xmlDoc.getElementsByTagName(GRP1);
  xmlvalue = xmlGRP.childNodes[0].childNodes[0].firstChild.nodeValue;
  xmlcontent = xmlGRP.childNodes[0].childNodes[1].firstChild.nodeValue;
  </code></pre>
  
  <p>Can anyone tell me what's wrong with my code?</p>