Extensions.DescendantsAndSelf Method (IEnumerable<XElement>, XName)
Returns a filtered collection of elements that contains every element in the source collection, and the descendents of every element in the source collection. Only elements that have a matching XName are included in the collection.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
public static IEnumerable<XElement> DescendantsAndSelf( this IEnumerable<XElement> source, XName name )
- Type: System.Collections.Generic.IEnumerable<XElement>
Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method, so Visual Basic users must use this axis method explicitly.
This method uses deferred execution.
Available since 8
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1