How to read xml document with XmlReader?
<p>I have a xml:  </p>

<pre><code>&lt;doc&gt;
****
&lt;book&gt;
    &lt;author&gt;Pete&lt;/author&gt;
    &lt;rating&gt;4&lt;/rating&gt;
    &lt;pages&gt;243&lt;/pages&gt;
&lt;/book&gt;
&lt;shop&gt;
    &lt;&gt;&lt;/&gt;
    &lt;&gt;&lt;/&gt;
&lt;/shop&gt;
&lt;/doc&gt;
</code></pre>

<p>I tried to read it with XmlReader:  </p>

<pre><code>using (XmlReader reader = XmlReader.Create(stream))
{
    reader.MoveToContent();
    //read some elements
    reader.ReadToFollowing("book");

}
</code></pre>

<p>But when i meet element <code>book</code> i dont know how to move inside, i mean how to read <code>author</code>, <code>rating</code> etc? And how to move to upper level again to read <code>shop</code> element.<br>
I tried <code>ReadToDescendant()</code> but dont think that its what i needed.<br>
Any advises?</p>

<p>Examples from comments dont helped me. I forget that i have a namespaces in document:</p>

<pre><code>&lt;doc&gt;
  ****
  &lt;book&gt;
      &lt;ns8:author&gt;Pete&lt;/ns8:author&gt;
      &lt;ns8:rating&gt;4&lt;/ns8:rating&gt;
      &lt;ns8:pages&gt;243&lt;/ns8:pages&gt;
  &lt;/book&gt;
  &lt;shop&gt;
      &lt;&gt;&lt;/&gt;
      &lt;&gt;&lt;/&gt;
  &lt;/shop&gt;
&lt;/doc&gt;
</code></pre>

<p>So i use NamespaceManager:</p>

<pre><code>  var nsmgr = new XmlNamespaceManager(reader.NameTable);
  nsmgr.AddNamespace("ns8", "namespace uri1");
  nsmgr.AddNamespace("ns6", "namespace uri2");
</code></pre>

<p>And read document:</p>

<pre><code>using (XmlReader reader = XmlReader.Create(stream))
{
   while (reader.Read())
   {
       if (reader.NodeType == XmlNodeType.Element)
       {
           reader.ReadToFollowing("book");
           reader.ReadToFollowing("ns8:author");
       }
}
</code></pre>

<p>But anyway line <code>reader.ReadToFollowing("ns8:author");</code> do not return <code>author</code> node.</p>