DescendantNodesAndSelf Method

Extensions.DescendantNodesAndSelf Method (IEnumerable<XElement>)

 

Returns a collection of nodes that contains every element in the source collection, and the descendant nodes of every element in the source collection.

Namespace:   System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

public static IEnumerable<XNode> DescendantNodesAndSelf(
	this IEnumerable<XElement> source
)

Parameters

source
Type: System.Collections.Generic.IEnumerable<XElement>

An IEnumerable<T> of XElement that contains the source collection.

Return Value

Type: System.Collections.Generic.IEnumerable<XNode>

An IEnumerable<T> of XNode that contains every element in the source collection, and the descendant nodes of every element in the source collection.

Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis for descendant nodes, so Visual Basic users must use this axis method explicitly.

This method uses deferred execution.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft