<PackageReference Include="System.Xml.XDocument" Version="4.0.11-beta-23409" />

System.Xml.Linq.Extensions

public static class Extensions
Contains the LINQ to XML extension methods.
public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T> source) where T : XNode

Returns a collection of elements that contains the ancestors of every node in the source collection.

public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T> source, XName name) where T : XNode

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

Returns a collection of elements that contains every element in the source collection, and the ancestors of every element in the source collection.

public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement> source, XName name)

Returns a filtered collection of elements that contains every element in the source collection, and the ancestors of every element in the source collection. Only elements that have a matching XName are included in the collection.

public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement> source)

Returns a collection of the attributes of every element in the source collection.

public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement> source, XName name)

Returns a filtered collection of the attributes of every element in the source collection. Only elements that have a matching XName are included in the collection.

public static IEnumerable<XNode> DescendantNodes<T>(this IEnumerable<T> source) where T : XContainer

Returns a collection of the descendant nodes of every document and element in the source collection.

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

public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T> source) where T : XContainer

Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T> source, XName name) where T : XContainer

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

Returns a collection of elements that contains every element in the source collection, and the descendent elements of every element in the source collection.

public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement> source, XName name)

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.

public static IEnumerable<XElement> Elements<T>(this IEnumerable<T> source) where T : XContainer

Returns a collection of the child elements of every element and document in the source collection.

public static IEnumerable<XElement> Elements<T>(this IEnumerable<T> source, XName name) where T : XContainer

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

public static IEnumerable<T> InDocumentOrder<T>(this IEnumerable<T> source) where T : XNode

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

public static IEnumerable<XNode> Nodes<T>(this IEnumerable<T> source) where T : XContainer

Returns a collection of the child nodes of every document and element in the source collection.

public static void Remove(this IEnumerable<XAttribute> source)

Removes every attribute in the source collection from its parent element.

public static void Remove<T>(this IEnumerable<T> source) where T : XNode

Removes every node in the source collection from its parent node.