The ancestor
axis contains the ancestors of the context node. The ancestors of the context node consist of the parent of the context node and the parent's parent, and so on. The ancestor
axis always includes the root node, unless the context node is the root node. The following example selects the book
ancestors of the context node: