title: Javascript XML - how to return a null value
body: <pre><code>&lt;Root&gt;
    &lt;Child1&gt;First Child Value&lt;/Child1&gt;
    &lt;Child2&gt;
      &lt;Age&gt;Age1 Value&lt;/Age&gt;
      &lt;Age /&gt;
      &lt;Name /&gt;
    &lt;/Child2&gt;
    &lt;Child3&gt;3-1&lt;/Child3&gt;
    &lt;Child3&gt;3-2&lt;/Child3&gt;
    &lt;Child4&gt;4&lt;/Child4&gt;
    &lt;Child5&gt;5&lt;/Child5&gt;
    &lt;Child6&gt;6&lt;/Child6&gt;
  &lt;/Root&gt;
  
  &lt;script&gt;
    var xmlDoc = xml.responseXML;
    var x = xmlDoc.getElementsByTagName("Root");
    alert(y[0].getElementsByTagName("Age")[0].childNodes[0].nodeValue);
    alert(y[0].getElementsByTagName("Age")[1].childNodes[0].nodeValue);
  &lt;script&gt;
  </code></pre>
  
  <p>I am trying to get a null value from "Root" > "Child2" > "Age[1]" but I get the message "0x800a138f - JavaScript runtime error: Unable to get property 'nodeValue' of undefined or null reference".</p>
  
  <p>Does anyone know where I am going wrong with this?</p>