title: Loop through XML with XmlDocument
body: <p>I'm new to using <code>Linq</code> and <code>XMLDocument</code>.</p>
  
  <p>I have a simple XML file and I want to loop through all of the elements and print the tag and value. I don't want to use the XML Tags when looping through. this is what I have so far.</p>
  
  <p>XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Step1&gt;One
  &lt;Step2&gt;Two
      &lt;Step3&gt;Three
          &lt;Step4&gt;Four
          &lt;/Step4&gt;
      &lt;/Step3&gt;
  &lt;/Step2&gt;
  &lt;/Step1&gt;    
  </code></pre>
  
  <p>C# Code</p>
  
  <pre><code>  private void StartIt()
      {
          System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
          xd.Load(@"C:\Projects\GetXML\testLayers.xml");
  
          XmlNodeList nl = xd.SelectNodes("Layer1");
  
          foreach (XmlNode xnode in nl)
          {
              Console.WriteLine(xnode.Name + " = " + xnode.InnerText); // + " " +   xnode.InnerXml);
          }
      }
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code> Step1 = One
  Two
      Three
          Four
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>Step1 = One
  Step2 = Two
  Step3 = Three
  Step4 = Four
  </code></pre>
  
  <p>Any suggestions?</p>