Let's take the code:
string
xml = "<node><![CDATA[line1\r\nline2]]></node>";XDocument doc = XDocument.Parse(xml);XCData data = doc.Element("node").FirstNode asXCData;Console.WriteLine(data.Value);
The console output seems to be OK, but the real content of data.Value is "line1\nline2", the carriage return \r characted has been removed. I have tried different parsing options, but couldn't find how to get the real content. Funny, but the inner xml text in this element is proper, only Value property has this character filtered.
I tried the same with System.Xml classes (XmlDocument, XmlCDataSection) and in this case I get the proper results. Does anyone know haw can I get it using XLINQ?