title: Read value from HTML node
body: <p>I'm new to XML/HTML-parsing. Don't even know the right words to do a proper search for duplicates.</p>
  
  <p>I have this HTML file which looks like this:  </p>
  
  <pre><code>&lt;body id="s1" style="s1"&gt;
      &lt;div xml:lang="uk"&gt;
          &lt;p begin="00:00:00" end="00:00:29"&gt;
            &lt;span fontFamily="SchoolHouse Cursive B" fontSize="18"&gt;I'm great!&lt;/span&gt;
          &lt;/p&gt;
  </code></pre>
  
  <p>Now I need <code>00:00:00</code>, <code>00:00:29</code> and <code>I'm great!</code> from it. I could read it like this:</p>
  
  <pre><code>XmlTextReader reader = new XmlTextReader(file);
  while (reader.Read())
  {
      if (reader.NodeType != XmlNodeType.Element)
          continue;
  
      if (reader.LocalName != "p")
          continue;
  
      var a = reader.GetAttribute(0);
      var b = reader.GetAttribute(1);
  
      if (reader.LocalName == "span")
      {
          XmlDocument doc = new XmlDocument();
          doc.Load(reader);
          XmlNode elem = doc.DocumentElement.FirstChild;
          var c = elem.InnerText;
      }
   }
  </code></pre>
  
  <p>I get values in variables <code>a</code>, <code>b</code> and <code>c</code>. But there was a slight change in HTML format. <strong>Now the HTML looks like this:</strong></p>
  
  <pre><code>&lt;body id="s1" style="s1"&gt;
    &lt;div xml:lang="uk"&gt;
        &lt;p begin="00:00:00" end="00:00:29"&gt;I'm great! &lt;/p&gt;
  </code></pre>
  
  <p>In this scenario how do I parse out <code>00:00:00</code>, <code>00:00:29</code> and <code>I'm great!</code> ? I tried this:</p>
  
  <pre><code>XmlTextReader reader = new XmlTextReader(file);
  while (reader.Read())
  {
      if (reader.NodeType != XmlNodeType.Element)
          continue;
  
      if (reader.LocalName != "p")
          continue;
  
      var a = reader.GetAttribute(0);
      var b = reader.GetAttribute(1);
  
      XmlDocument doc = new XmlDocument();
      doc.Load(reader);
      XmlNode elem = doc.DocumentElement.FirstChild;
      var c = elem.InnerText;
  }
  </code></pre>
  
  <p>But I get this error: <code>This document already has a 'DocumentElement' node.</code> at line <code>doc.Load(reader)</code>. How to read correctly and what's causing the trouble? I am using .NET 2.0</p>