title: vb.net Reading XMLFile
body: <p>I have a huge XML File (20'000 Rows) and i want to read some Data out of it.
  I have written an Routine by now. My Question is, is there a way to make it look better? Because i think that's an ugly way to get the Data out of the File.</p>
  
  <p>This is the Structure of my XML File</p>
  
  <pre><code>&lt;List
  &lt;Header&gt;
  &lt;/&gt;
  &lt;Root&gt;
      &lt;Items&gt;
          &lt;Object&gt;
              &lt;Items&gt;
                  &lt;Object&gt;
                      &lt;Items&gt;
                          &lt;Object&gt;
                              &lt;Items&gt;
                                  &lt;Object&gt;
                                      &lt;IoItems&gt;
                                          &lt;IoObject&gt;
                                          &lt;/&gt;
                                      &lt;/&gt;
                                  &lt;/&gt;
                              &lt;/&gt;
                              &lt;IoItems&gt;                           
                                  &lt;IoObject&gt;
                                  &lt;/&gt;
                              &lt;/&gt;
                          &lt;/&gt;
                          &lt;Object&gt;
                          &lt;/&gt;
                          &lt;Object&gt;
                          &lt;/&gt;
                          &lt;Object&gt;
                          &lt;/&gt;
                      &lt;/&gt; 
                  &lt;/&gt; 
                  &lt;Object&gt;
                      //Like the Object above
                  &lt;/&gt;
                  &lt;StructureObject&gt;
                      //Like the Object above
                  &lt;/&gt;
              &lt;/&gt; 
          &lt;/&gt; 
      &lt;/&gt; 
  &lt;/&gt; 
  </code></pre>
  
  <p></p>
  
  <p>And my Code looks like that:</p>
  
  <pre><code>Dim myXMLDoc As New XmlDocument
          Dim Node As XmlNode
          Dim Node2 As XmlNode
          Dim Node3 As XmlNode
          Dim Node4 As XmlNode
          Dim Node5 As XmlNode
          Dim Node6 As XmlNode
          Dim Node7 As XmlNode
          Dim Node8 As XmlNode
          Dim Node9 As XmlNode
          Dim Node10 As XmlNode
          Dim Node11 As XmlNode
  
          myXMLDoc.Load("H:\Data.xml")
          Dim root As XmlNode = myXMLDoc.GetElementsByTagName("Root")(0)
  
          For Each Node In root.ChildNodes
              If Node.Name = "Items" Then
                  For Each Node2 In Node.ChildNodes
                      If Node2.Name = "Object" Then
                          For Each Node3 In Node2.ChildNodes
                              If Node3.Name = "Items" Then
                                  For Each Node4 In Node3.ChildNodes
                                      If Node4.Name = "Object" Then
                                          For Each Node5 In Node4.ChildNodes
                                              If Node5.Name = "Items" Then
                                                  For Each Node6 In Node5.ChildNodes
                                                      If Node6.Name = "Object" Then
                                                          For Each Node7 In Node6.ChildNodes
                                                              If Node7.Name = "Items" Then
                                                                  For Each Node8 In Node6.ChildNodes
                                                                      If Node8.Name = "Object" Then
                                                                          For Each Node9 In Node8.ChildNodes
                                                                              If Node9.Name = "IoItems" Then
                                                                                  For Each Node10 In Node9.ChildNodes
                                                                                      If Node10.Name = "IoObject" Then
                                                                                          MsgBox(Node10.Value)
                                                                                      End If
                                                                                  Next
                                                                              End If
                                                                          Next
                                                                      End If
                                                                  Next
                                                              ElseIf Node6.Name = "IoItems" Then
                                                                  For Each Node11 In Node6.ChildNodes
                                                                      If Node11.Name = "IoObject" Then
                                                                          MsgBox(Node11.Value)
                                                                      End If
                                                                  Next
                                                              End If
                                                          Next
                                                      End If
                                                  Next
                                              End If
                                          Next
                                      End If
                                  Next
                              End If
                          Next
                      End If
                  Next
              End If         
          Next
  </code></pre>