title: Retrieve specific values from specific nodes - VB.NET XML HTTP GET
body: <p>I have a program I am writing that calls a Feed using HTTP GET that returns XML.</p>
  
  <p>I have written code to be able to read each Element and their Values but I only wish to retrieve specific Element Values to specific variables.</p>
  
  <p>I could use nested If statements to check for the 'reader.value' and then put it to the relevant variable but feel this seems cumbersome and would like to have a better understanding.</p>
  
  <p>This is my current code:</p>
  
  <pre><code>Const URLString As String = "https://geturl"
      Dim reader As XmlTextReader = New XmlTextReader(URLString)
  
      Do While (reader.Read())
          Select Case reader.NodeType
              Case XmlNodeType.Element 'Display beginning of element.
                  Console.Write("&lt;" + reader.Name)
                  If reader.HasAttributes Then 'If attributes exist
                      While reader.MoveToNextAttribute()
                          'Display attribute name and value.
                          Console.Write(" {0}='{1}'", reader.Name, reader.Value)
                          MsgBox(reader.Value)
                      End While
                  End If
                  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>This is the information that is returned:</p>
  
  <pre><code>&lt;result id="4198608" generated="1399463340" mode="live" account_id="428"&gt;
  &lt;vrm&gt;GY08OJB&lt;/vrm&gt;
  &lt;make&gt;AUDI&lt;/make&gt;
  &lt;model&gt;A6 SE TDI&lt;/model&gt;
  &lt;colour&gt;BLACK&lt;/colour&gt;
  &lt;body&gt;ESTATE&lt;/body&gt;
  &lt;doors&gt;5 DOORS&lt;/doors&gt;
  &lt;engine_size&gt;1968&lt;/engine_size&gt;
  &lt;fuel&gt;HEAVY OIL&lt;/fuel&gt;
  &lt;/result&gt;
  </code></pre>
  
  <p>I wish to return each individual node to an individual record so I can return it to some textboxes.</p>
  
  <p>Cheers :/</p>