title: Illegal characters in XML
body: <p>I have a .NET application written in C# that saves information in XML format. The application serializes the application data into xml. The application contains a textbox where the user is free to enter any text. I have cases where users have managed to enter characters, mostly when they copy and paste text from other applications into the textbox, where the xml document becomes corrupted. Is there a general approach to manage illegal characters in xml documents without having to filter them out in every textbox on entry.</p>
  
  <p>Sample from document thats corrupted</p>
  
  <pre><code>&lt;Propery&gt;
    &lt;Name&gt;&amp;#x8;Alimentação Controlador&lt;/Name&gt;
    &lt;Value&gt;24&lt;/Value&gt;
    &lt;Unit&gt;Vca&lt;/Unit&gt;
  &lt;/Propery&gt;
  </code></pre>
  
  <p>Document is serialized with ASCIIEncoding.UTF8</p>