title: parse xml in vb.net
body: <p>I am given an XML file. It is formed like this:</p>
  
  <pre><code>      &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;dataset  xmlns="http://developer.cognos.com/schemas/xmldata/1/"      xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;!--
  &lt;dataset
      xmlns="http://developer.cognos.com/schemas/xmldata/1/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
          xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"&gt;
  --&gt;
  &lt;metadata&gt;
      &lt;item name="Level" type="xs:short" precision="1"/&gt;
      &lt;item name="ID" type="xs:string" length="14"/&gt;
      &lt;item name="Name" type="xs:string" length="52"/&gt;
  &lt;/metadata&gt;
  
  &lt;data&gt;
      &lt;row&gt;
          &lt;value&gt;2&lt;/value&gt;
          &lt;value&gt;101   &lt;/value&gt;
          &lt;value&gt;Location 1&lt;/value&gt;
      &lt;/row&gt;
      &lt;row&gt;
          &lt;value&gt;2&lt;/value&gt;
          &lt;value&gt;103   &lt;/value&gt;
          &lt;value&gt;Location 2&lt;/value&gt;
      &lt;/row&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am having trouble parsing this. There are hundreds of articles online - but all of them have a different format than the data handed to me.
  Can anyone point me in the right direction for VB.NET on Framework 3.5?
  I am used to seeing data more like this:</p>
  
  <pre><code>    &lt;item name="Future" collected="yes"&gt;
  </code></pre>
  
  <p>EDIT:
  So, I have tried this:</p>
  
  <pre><code>Dim reader As XmlTextReader = New XmlTextReader(fileToSave)
  
  Do While (reader.Read())
  
  Select Case reader.NodeType
                      Case XmlNodeType.Element 'Display beginning of element.
                          Console.Write("&lt;" + reader.Name)
                          Console.WriteLine("&gt;")
                      Case XmlNodeType.Text 'Display the text in each element.
                          Console.WriteLine(reader.Value)
                      Case XmlNodeType.EndElement 'Display end of element.
                          Console.Write("&lt;/" + reader.Name)
                          Console.WriteLine("&gt;")
                  End Select
              Loop
  </code></pre>
  
  <p>What I need is the Row items to be able to populate a combobox - this just gives me the same thing as the XML file:</p>
  
  <pre><code>    &lt;dataset&gt;
  &lt;metadata&gt;
  &lt;item&gt;
  &lt;item&gt;
  &lt;item&gt;
  &lt;/metadata&gt;
  &lt;data&gt;
  &lt;row&gt;
  &lt;value&gt;
  2
  &lt;/value&gt;
  &lt;value&gt;
  101   
  &lt;/value&gt;
  &lt;value&gt;
  Location 1
  &lt;/value&gt;
  &lt;/row&gt;
  &lt;row&gt;
  &lt;value&gt;
  2
  &lt;/value&gt;
  &lt;value&gt;
  103   
  &lt;/value&gt;
  &lt;value&gt;
  Location 2
  &lt;/value&gt;
  &lt;/row&gt;
  &lt;/data&gt;
  &lt;/dataset&gt;
  </code></pre>