Escaping characters for an XML string in .NET

From the stuff I should know but didn’t until yesterday dept:

Handy method in the System.Security namespace for replacing invalid XML characters with their escaped equivalents:

SecurityElement.Escape(string str)

Leave a Reply