The AncestorsAndSelf operator can be called on a sequence of elements and returns a sequence containing the ancestor elements of each source element and the source element itself. This operator is just like the Ancestors operator except for the fact that it can only be called on elements, as opposed to nodes, and also includes each source element in the returned sequence of ancestor elements.
The AncestorsAndSelf operator has two prototypes.
public static IEnumerable<XElement> AncestorsAndSelf ( this IEnumerable<XElement> source )
This version of the operator can be called on a sequence of elements and returns a sequence of elements containing each source element itself ...