public static void Main(string[] args)
const string xml = @"<location>
<country>United States</country>
var doc = XDocument.Parse(xml);
doc.Root.Element("city").Value = "London";
doc.Root.Element("state").Value = "Some value with & <> in";
doc.Root.Element("country").ReplaceNodes(new XCData("Some CDATA content with & <>"));