I'm trying to add the ASCII carriage return
to the end of a string in an XmlNode's InnerText
like this:
XmlNode spanNode = doc.CreateElement("span");
spanNode.InnerText = "carriage return here: ";
rootNode.AppendChild(spanNode);
But this ends up escaping the string, so that it appears in rootNode
's OuterXml like this:
carriage return here: 
How do I add this text if I actually want the unescaped carriage return?
EDIT: if it makes a difference, this is for text that will be displayed in a PDF annotation. I'm changing the value of the RC
key that defines the rich text--removing some existing <span>
elements with this carriage return and adding new ones that have an identical carriage return.
Here's what I want to end up with:
<root>
<span>carriage return here: </span>
</root>