title: xpath in vb.net how to iterate in an iteration
body: <p>this is probably a silly question and the solution is something i overlooked, but suppose the following xml file (below)</p>
  
  <p>I am iteratiing through the info/test items and then want to iterate again through the test_properties, but I don't know how.</p>
  
  <p>the properties are never a fixed count, so it could have 1 property or 200
  i need the type='" attribute and the value of the property
  I use this so far:</p>
  
  <pre><code>    Dim Xml_Document As XPathDocument = New XPathDocument("e:\test.xml")
              Dim Navigator As XPathNavigator = Xml_Document.CreateNavigator()
              Dim ns As XmlNamespaceManager = New XmlNamespaceManager(Navigator.NameTable)
              Dim NodeIterator As XPathNodeIterator = Navigator.Select("/info/test")
  
  
              Try
                  While NodeIterator.MoveNext()
                      Dim sanction_id As Integer = CInt(NodeIterator.Current.GetAttribute("id", ns.DefaultNamespace))
                      Dim clone As XPathNavigator = NodeIterator.Current.Clone()
  
                      clone.MoveToFirstChild()
                      MsgBox(clone.Value)
                      clone.MoveToNext()
                      MsgBox(clone.Value)
                      clone.MoveToNext()
                      MsgBox(clone.Value)
                      clone.MoveToNext()
                      MsgBox(clone.Value)
                      clone.MoveToNext()
                      MsgBox(clone.Value)
                      clone.MoveToNext()
                      MsgBox(clone.Value)
                      clone.MoveToNext()
  ''''''''
  ' here i want to iterate through test_properties for each property 
  '''''''
  
                  End While
              Catch ex As Exception
                  Console.WriteLine(ex.StackTrace)
              End Try
  </code></pre>
  
  <p>and the xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;info&gt;
      &lt;test id="1"&gt;
          &lt;test_source&gt;ONLINE&lt;/test_source&gt;
          &lt;test_type&gt;&lt;![CDATA[P]]&gt;&lt;/test_type&gt;
          &lt;test_date&gt;&lt;![CDATA[2012-02-23]]&gt;&lt;/test_date&gt;
          &lt;test_programme&gt;&lt;![CDATA[UK]]&gt;&lt;/test_programme&gt;
          &lt;test_remark&gt;&lt;![CDATA[Nice guy]]&gt;&lt;/test_remark&gt;
          &lt;test_key&gt;123456789&lt;/test_key&gt;
          &lt;test_properties&gt;
              &lt;property type="FIRSTNAME"&gt;&lt;![CDATA[Robert]]&gt;&lt;/property&gt;
              &lt;property type="MIDDLENAME"&gt;&lt;![CDATA[]]&gt;&lt;/property&gt;
              &lt;property type="LASTNAME"&gt;&lt;![CDATA[Johnson]]&gt;&lt;/property&gt;
              &lt;property type="GENDER"&gt;&lt;![CDATA[M]]&gt;&lt;/property&gt;
              &lt;property type="BIRTHDATE"&gt;&lt;![CDATA[1900-01-01]]&gt;&lt;/property&gt;
          &lt;/test_properties&gt;
      &lt;/test&gt;
      &lt;test id="2"&gt;
          &lt;test_source&gt;ONLINE&lt;/test_source&gt;
          &lt;test_type&gt;&lt;![CDATA[P]]&gt;&lt;/test_type&gt;
          &lt;test_date&gt;&lt;![CDATA[2012-02-23]]&gt;&lt;/test_date&gt;
          &lt;test_programme&gt;&lt;![CDATA[UK]]&gt;&lt;/test_programme&gt;
          &lt;test_remark&gt;&lt;![CDATA[Nice girl]]&gt;&lt;/test_remark&gt;
          &lt;test_key&gt;123456789&lt;/test_key&gt;
          &lt;test_properties&gt;
              &lt;property type="FIRSTNAME"&gt;&lt;![CDATA[Roberta]]&gt;&lt;/property&gt;
              &lt;property type="MIDDLENAME"&gt;&lt;![CDATA[]]&gt;&lt;/property&gt;
              &lt;property type="LASTNAME"&gt;&lt;![CDATA[Johnsons]]&gt;&lt;/property&gt;
              &lt;property type="GENDER"&gt;&lt;![CDATA[M]]&gt;&lt;/property&gt;
              &lt;property type="BIRTHDATE"&gt;&lt;![CDATA[1900-01-01]]&gt;&lt;/property&gt;
          &lt;/test_properties&gt;
      &lt;/test&gt;
  &lt;/info&gt;
  </code></pre>