日期:2014-05-20 浏览次数:20757 次
XDocument xml = new XDocument( new XElement("Parent", new XElement("Child1","Child1 Data"), new XElement("Child2","Child2 Data") ) ); string result = (from x in xml.Elements("Parent").Elements() where x.Value == "Child1 Data" select x.Value).First(); Console.WriteLine(result);