The ancestor axis selects the parent node of the context node, the parent of that node, its parent, and so
on until the root node of the document is selected.
If the context node is the root node, the ancestor axis returns an empty node-set.
If you had an XML document such as
This is the first section.
This is the second section.
content
and the context node were the second Sectionelement node in Chapter 1, then the location path
ancestor::*
would return the Chapter element node, which has a number attribute node with a value of 1, the Book element node, and the root node.