title: XmlDocument.Load Replacing ">"
body: <p>When running the following code:</p>
  
  <pre><code> static void Main(string[] args)
      {
          var xmlDoc = new XmlDocument();
  
          var fileReader = new BinaryReader(File.Open(@"C:\Users\username\Desktop\doc.xlf",FileMode.Open,FileAccess.Read,FileShare.Read));
          var sourceStream = new MemoryStream(fileReader.ReadBytes((int)fileReader.BaseStream.Length));
          xmlDoc.Load(sourceStream);
      }
  </code></pre>
  
  <p>On a file with a node that looks like this:</p>
  
  <pre><code>&lt;source xml:lang="en-us"&gt;
          &amp;lt;b&gt;This text is displayed in Bold.&amp;lt;/b&gt;&amp;lt;br&gt;
          &amp;lt;i&gt;This text is displayed in italics.&amp;lt;/i&gt;
  &lt;/source&gt;
  </code></pre>
  
  <p>The node gets converted to the following when it is read in:</p>
  
  <pre><code>&lt;source xml:lang="en-us"&gt;
          &amp;lt;b&amp;gt;This text is displayed in Bold.&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;
          &amp;lt;i&amp;gt;This text is displayed in italics.&amp;lt;/i&amp;gt;
  &lt;/source&gt;
  </code></pre>
  
  <p>In other words, all <code>&gt;</code> are being replaced with <code>&amp;gt;</code></p>
  
  <p>Normally that would be OK (and I am even under the impression that it would be technically legal, even if bad practice), but in this case it is <strong>absolutely imperative</strong> that the node not change when it is read in.  Any thoughts on either (1) how to read in the xml to allow <code>&gt;</code> or (2) how to work around this issue?  Thanks!</p>