title: Select all nodes
body: <p>I want to obtain all elements in the xml file.</p>
  
  <p>I'm getting only the first element.</p>
  
  <pre><code>XmlDocument XDoc = new XmlDocument();
              XDoc.Load("d://avi.xml");        
              XmlNodeList XList = XDoc.SelectNodes("//level1");
              foreach (XmlNode XNode in XList)
              {
                  Console.WriteLine("the current node is - {0}", XNode.Name);
              }
  </code></pre>
  
  <p>The xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;level1&gt;
      &lt;level2&gt;
          &lt;level3&gt;header3&lt;/level3&gt;
              &lt;level4&gt;another&lt;/level4&gt;
          &lt;level31&gt;header31&lt;/level31&gt;
      &lt;/level2&gt;
      &lt;level2&gt;
          &lt;level3&gt;nnn&lt;/level3&gt;
          &lt;level31&gt;nnnnn&lt;/level31&gt;
      &lt;/level2&gt;
  &lt;/level1&gt;
  &lt;!--test test--&gt;
  </code></pre>