title: How can I iterate through an Elements child nodes using Javascript?
body: <p>I'm trying to iterate through a DOM elements children and display their attributes in my code:</p>
  
  <pre><code>document.write("&lt;table border='1'&gt;");
  var testcaseiterator = xmlDoc.getElementsByTagName("TestCase")[1].childNodes;
  
  for(i=0; i &lt; testcaseiterator.length; i++){
  
      document.write("&lt;tr&gt;&lt;td&gt;");
      document.write(testcaseiterator[i].getAttribute('name'));
      document.write("&lt;/td&gt;&lt;/tr&gt;");
  }
  document.write("&lt;/table&gt;");
  </code></pre>
  
  <p>My XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="XSLTOutput2.xsl"?&gt;
  &lt;TestSuite&gt;
    &lt;ActiveStep case="6" step="14" /&gt;
    &lt;TestCase name="Visit all buttons [in region Button: Navi 0]"&gt;
      &lt;Verification type="screen" id="1e542f75-1ba2-482d-8edd-39f70620d6dd" status=""&gt;
        &lt;screen widgetid="audio_radio_fm"&gt;
          &lt;menu entryStrategy="FIRST" looped="false" orientation="HORIZONTAL" selectable="true" widgetid="status"&gt;
            &lt;entry selectable="true" widgetid="status" widgettype="entry"&gt;
              &lt;label widgetid="status_label"&gt;status&lt;/label&gt;
            &lt;/entry&gt;
          &lt;/menu&gt;
          &lt;menu entryStrategy="SECOND" looped="false" orientation="HORIZONTAL" selectable="true" widgetid="apl"&gt;
            &lt;button selectable="true" widgetid="apl_navi" widgettype="button"&gt;
              &lt;label widgetid="apl_navi_label"&gt;Navi&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="apl_audio" widgettype="button"&gt;
              &lt;label widgetid="apl_audio_label"&gt;Audio&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="apl_tel" widgettype="button"&gt;
              &lt;label widgetid="apl_tel_label"&gt;Tel&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="apl_video" widgettype="button"&gt;
              &lt;label widgetid="apl_video_label"&gt;Video&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="apl_system" widgettype="button"&gt;
              &lt;label widgetid="apl_system_label"&gt;System&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="apl_net" widgettype="button"&gt;
              &lt;img src="img/apl_net.png" widgetid="apl_net_image" /&gt;
            &lt;/button&gt;
          &lt;/menu&gt;
          &lt;menu entryStrategy="FIRST" looped="false" orientation="HORIZONTAL" selectable="true" widgetid="plf"&gt;
            &lt;entry selectable="true" widgetid="playfield" widgettype="entry"&gt;
              &lt;label widgetid="playfield_label"&gt;playfield&lt;/label&gt;
            &lt;/entry&gt;
          &lt;/menu&gt;
          &lt;menu entryStrategy="MIDDLE" looped="false" orientation="HORIZONTAL" selectable="true" widgetid="audio_radio_sfl"&gt;
            &lt;button selectable="true" widgetid="audio_radio_sfl_radio" widgettype="button"&gt;
              &lt;label widgetid="audio_radio_sfl_radio_label"&gt;Radio&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="audio_radio_sfl_presets" widgettype="button"&gt;
              &lt;label widgetid="audio_radio_sfl_presets_label"&gt;Presets&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="audio_radio_sfl_info" widgettype="button"&gt;
              &lt;label widgetid="audio_radio_sfl_info_label"&gt;Info&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="audio_radio_sfl_fm" widgettype="button"&gt;
              &lt;label widgetid="audio_radio_sfl_fm_label"&gt;FM&lt;/label&gt;
            &lt;/button&gt;
            &lt;button selectable="true" widgetid="audio_radio_sfl_sound" widgettype="button"&gt;
              &lt;label widgetid="audio_radio_sfl_sound_label"&gt;Sound&lt;/label&gt;
            &lt;/button&gt;
          &lt;/menu&gt;
        &lt;/screen&gt;
      &lt;/Verification&gt;
      &lt;Verification optionID="Audio" type="focus" id="d713b58b-06b1-4274-9a79-fe90a071383c" status="" /&gt;
      &lt;Command type="cce:left" id="3a591a3c-9b9f-41a7-9b50-0892197128ec" status="" /&gt;
      &lt;Verification optionID="Navi" type="focus" id="6037419a-25ae-4a7f-b842-0e88df9dfe4c" status="" /&gt;
    &lt;/TestCase&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is not working: Any ideas?</p>