Search

Basic Linq to XML

This example shows a bsic Linq to XML.


XElement root2 = XElement.Parse(xmlString);

IEnumerable tests =
from el in root2.Elements("Root")
where (string)el.Element("elementName") == "searchPattern"
select el.Element("pickElement");

string cc= tests.Single().Value;