I migrate a set of services in .Net 4.0 and find (much to my disappointment) that the character objects that I create and save in XElement.Value () are โrestoredโ to their original character values โโwhen I convert an XDocument object to an XML stream for HTTP response.
The escaped characters must appear in the XML document as characters (for example, ® and not ยฎ) in order to remain compatible with legacy applications that were written to allow character objects for non-Latin characters.
Is there a way (another type of document or Encoding () method or something else) Can I configure XDocument to save these character entities when creating my XML stream? Maybe there is an alternative to XDocument or XmlDocument that I can use instead?
source share