Descendants (XElement Dynamic Property)

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Gets an indexer used to retrieve all the descendant elements of the current element that match the specified expanded name.

Syntax

elem.Descendants[{namespaceName}localName]

Property Value/Return Value

An indexer of the type IEnumerable<XElement> Item(String expandedName). This indexer takes the expanded name of the specified descendant elements and returns the matching child elements in an IEnumerable<XElement> collection.

Remarks

This property is equivalent to the System.Xml.Linq.XContainer.Descendants(XName) method of the XContainer class.

The elements in the returned collection are in XML source document order.

This property uses deferred execution.

See Also

XElement Class Dynamic Properties Elements