title: XmlReader stops at nested while
body: <p>I have this xml:</p>
  
  <pre><code>&lt;Root&gt;
     &lt;Client&gt;
       &lt;Name&gt;Some Name&lt;/Name&gt;
       &lt;Messages&gt;
           &lt;Type name="mail" value="a@a.com"&gt;&lt;/Type&gt;
           &lt;Type name="chat" value="some-username"&gt;&lt;/Type&gt;
       &lt;/Messages&gt;
     &lt;/Client&gt;
     ...................MORE CLIENTS HERE
  &lt;/Root&gt;
  </code></pre>
  
  <p>I loop through it with xmlreader and It is working as expected.<br>
  the problem is when I try to loop on nodes <code>"&lt;Type"</code>, this is where the first code get stop.</p>
  
  <p>The code reads the xml correctly, but it stop after the first iteration of the nested while:</p>
  
  <pre><code>using (XmlReader reader = XmlReader.Create(new StringReader(xmlString), settings))
  {
      while (reader.ReadToFollowing("Client"))
      {
           reader.ReadToFollowing("Name");
           var message = reader.ReadElementContentAsString();
           Trace.WriteLine("message: " + message);
  
           while (reader.ReadToFollowing("Type")){
                var value = reader.GetAttribute("value");
                var name = reader.GetAttribute("name");
  
           }//everything stops here///
      }
  }
  </code></pre>
  
  <p>How can I continue after the first client?<br>
  thanks</p>