Escaping invalid XML characters in C#

I was looking for a simple method by which I could escape invalid XML characters in a string. I searched hi and lo :) and then I found this blog. It pointed me in the right direction. You can use SecurityElement.Escape(string) to do this.

Leave a Reply