title: Convert special ASCII Character to XML Compatible string in C++
body: <p>Is there an API C++ which I can use to convert special character to XML comptible string?
  Example change </p>
  
  <pre><code>We're sorry, &lt;your&gt; item is out of stock will not be Δ available  (until next month). ÿ
  </code></pre>
  
  <p>to </p>
  
  <pre><code>We're sorry, &amp;#x03C;your&amp;#x03E; item is out of stock will not be &amp;#x03F; available  &amp;#x028;until next month&amp;#x029;. &amp;#x0FF;
  </code></pre>
  
  <p>Let me explain a bit more about my problem. I work on a Legacy server, which pulls out data reports in Flat files. In to older versions of our client Application, everything works fine with these special chars like &lt;, >, ( etc. </p>
  
  <p>We now are developing a new client, but this client accepts a XML string and render the report on a PHP page. So we made changes to allow the system to output a XML file. But when the XML reaches the client, and if the string contains a funny char like &lt; or ) etc, the DOM parser inside the PHP page starts throwing error. What I want to do is while the XML fine is being created, and if some such special chars are I need to display them in the report hence need to escape 
              &lt;  as &amp;#x03C</p>
  
  <p>I API a function InternetCanonicalizeUrl which will change a string for URL encoding. 
  I want something similar for XML</p>