title: Properly reading a nested XML document using an XmlReader.ReadInnerXML in .NET 3.5
body: <p>I'm using an XmlReader.ReadInnerXML to read an XML document (as text) embedded within in an element of an outer XML document.  This works fine except for the handling of tab characters in attributes of the inner XML.  Example:</p>
  
  <pre><code>&lt;document&gt;
    &lt;interface&gt;
      &lt;scriptaction script="&amp;#x9;one tab&amp;#xD;&amp;#xA;&amp;#x9;&amp;#x9;two tabs&amp;#xD;&amp;#xA;&amp;#x9;&amp;#x9;&amp;#x9;three tabs" /&gt;
    &lt;/interface&gt;
  &lt;/document&gt;
  </code></pre>
  
  <p>When ReadInnerXML is used at the "document" element level, the resulting string looks like this:</p>
  
  <pre><code>&lt;interface&gt;&lt;scriptaction script=" one tab&amp;#xD;&amp;#xA;  two tabs&amp;#xD;&amp;#xA;   three tabs"/&gt;&lt;/interface&gt;
  </code></pre>
  
  <p>IOW, the tabs are turned into actual tab characters.  Then when we then parse the resulting inner document, the tabs are normalized into spaces in the usual whitespace handling fashon, and the result is the conversion of tab characters to spaces.  We need to preserve the attribute values as they are.</p>
  
  <p>We've tried messing with various XmlReader settings to no avail.  Is this possibly a defect in the reader, or something we're doing wrong?</p>
  
  <p>Thanks in advance,</p>
  
  <p>--
  Nathan Allan -
  Database Consulting Group</p>