I have a weird behavior with XElement. It seems the Value property changes the new line expression \r\n to the unix like expression \n. Why is that?
string valueString = "abc\r\ndef";
string xmlString = "<desc>abc\r\ndef</desc>";
XElement xElement = XElement.Parse(xmlString);
string toString = xElement.ToString(); //as expected same value as xmlString
string xElementValue = xElement.Value; //contains abc\ndef instead of abc\r\ndef
Thanks!