softpcapps Software
CODE HELP BLOG
string text_to_encode="this is < a test > !";
XmlDocument xmlDoc = new XmlDocument();
XmlElement xmlElement = xmlDoc.CreateElement("Str");
xmlElement.InnerText = text_to_encode;
string xml_encoded_text= xmlElement.InnerXml;
Please note that you have to also add "using System.XML;" on the top.