In the following code I am using XPath to find all of the matching nodes using XPath, and appending the values to a StringBuilder.
StringBuilder sb = new StringBuilder();
foreach (XmlNode node in this.Data.SelectNodes("ID/item[@id=200]/DAT[1]/line[position()>1]/data[1]/text()"))
{
sb.Append(node.Value);
}
return sb.ToString();
How do I do the same thing, except using Linq to XML instead? Assume that in the new version, this.Data is an XElement object.