title: Replace Hexadecimal back to original string text
body: <p>using following method to replace invalid xml characters before calling XDocument.LoadXml in Web Service as:</p>
  
  <pre><code>[WebMethod]
  public XmlDocument GetXml(string text)
  {
      XElement xElement = new XElement("RootNode");
      xElement.Add(new XElement("title", SanitizeHexaDecimalSymbol(text))
      var xmldoc = new XmlDocument();
      xmldoc .LoadXml(xElement.Tostring())
  }
  
  private static string SanitizeHexaDecimalSymbol(string txt)
  {
     string regEx = "[\x00-\x08\x0B\x0C\x0E-\x1F\x26]";
     return Regex.Replace(text, regEx, "", RegexOptions.Compiled);
  }
  </code></pre>
  
  <p>How do I have replace back the sanitized text to its original text.
  I don't want to use hard code way to replace text back to its original text.</p>
  
  <p>Is there a method where i can call as DesanitizeHexaDecimalSymbol(text) method, I'm not sure what would be the implementation inside this method to get back original text.</p>
  
  <p>Solution:
  I followed the @Zohar Solution to make it as a work around for replacing back the original text from the hexadexcmal symbol.</p>