title: C# xml read all childnodes
body: <p>I'm completely new to C# and XML parsing so I like to ask how can I read all nodes within this xml file?</p>
  
  <pre><code>&lt;root&gt;
      &lt;info&gt;
          &lt;name&gt;
              &lt;first&gt;bob&lt;/first&gt;
              &lt;last&gt;john&lt;/last&gt;
              &lt;middle&gt;D&lt;/middle&gt;
          &lt;/name&gt;
          &lt;age&gt;35&lt;/age&gt;
          &lt;sex&gt;male&lt;/sex&gt;
          &lt;id&gt;12345&lt;/id&gt;
      &lt;/info&gt;
  
      &lt;info&gt;
          &lt;name&gt;
              &lt;first&gt;jack&lt;/first&gt;
              &lt;last&gt;dawnson&lt;/last&gt;
              &lt;middle&gt;D&lt;/middle&gt;
          &lt;/name&gt;
          &lt;age&gt;23&lt;/age&gt;
          &lt;sex&gt;male&lt;/sex&gt;
          &lt;id&gt;23456&lt;/id&gt;
      &lt;/info&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I could get the value for age,sex,and id but not name or its childnodes.Here is what I got so far?</p>
  
  <pre><code>XmlDocument doc = new XmlDocument(); 
  doc.LoadXml(xmlOut);  
  XmlNodeList node = doc.SelectNodes("/root/Info");  
  Employee empOne = new Employee();  
  
  foreach (XmlNode childNode in node)  
  {
      empOne.Age = childNode["age"].InnerText;
      empOne.Sex = childNode["sex"].InnerText;
      empOne.ID = childNode["id"].InnerText;
  
      foreach (XmlNode node2 in childNode.ChildNodes)
      {
          empOne.FirstName = node2["first"].InnerText;
          empOne.LastName = node2["last"].InnerText;
      }  
  }
  </code></pre>