I am using LINQ to XML to write an element to an xml document. The problem i am having is that the string i try to write to the xml element has characters such as &, <, > and ".
When i write it to xml using the following code,
XElement Config= new XElement("Student", new XElement("ID", "><&\""));
I dont get these special characters being written to the XML document. Instead i get things like < for < and > for >
. How can i escape these characters while writing them to xml?
Thanks