title: Remove all hexadecimal characters before loading string into XML Document Object?
body: <p>I have an xml string that is being posted to an ashx handler on the server. The xml string is built on the client-side and is based on a few different entries made on a form. Occasionally some users will copy and paste from other sources into the web form. When I try to load the xml string into an <code>XMLDocument</code> object using <code>xmldoc.LoadXml(xmlStr)</code> I get the following exception:</p>
  
  <pre><code>System.Xml.XmlException = {"'', hexadecimal value 0x0B, is an invalid character. Line 2, position 1."}
  </code></pre>
  
  <p>In debug mode I can see the rogue character (sorry I'm not sure of it's official title?):</p>
  
  <p>My questions is how can I sanitise the xml string before I attempt to load it into the XMLDocument object? Do I need a custom function to parse out all these sorts of characters one-by-one or can I use some native .NET4 class to remove them?</p>
  
  <p><img src="https://i.stack.imgur.com/xwByV.png" alt="Rogue character in debug mode"></p>