I have come across two ways querying XElements or XAttributes: Make an object IEnumerable and loop through the results Use the Single() method to return a single object only Typically you may have a situation where you write some Linq-to-XML like this: IEnumerable attrib = from att in elemInner.Attributes() where (string)att.Name.ToString() == “sectionName” select att; [...]
Continue reading about Getting a single XAttribute or XElement