string xml = @"<root><element1>Text1</element1> <element2>Text2</element2 </root>";
XDocument xdoc = XDocument.Parse(xml);
// 读取XML文件
XElement root = XElement.Parse(xml);
XElement element1 = root.Element("element1");
Console.WriteLine("Element1: " + element1.Value);
XElement element2 = root.Element("element2");
Console.WriteLine("Element2: " + element2.Value);