Let's see how this rule works by testing it against some common cases:
If the pattern is title then a node matches the pattern if the node is included in the result of the expression root(.)//(title) which is the same as //title . This expression selects all elements in the document, so a node matches the pattern if and only if it is a element.
If the pattern is chapter|appendix then a node matches the pattern if it is selected by the expression root(.)//(chapter|appendix) This expression is equivalent to //chapter | //appendix and matches all and elements in the document.
If the pattern is / then a node matches if it is selected by the expression root(.)//(/) This rather strange XPath expression selects the root node of every descendant of the root node, and then eliminates duplicates: so it is actually equivalent to the expression / which selects the root node only. (There are complications if the root node is not a document node, for example if it is a parentless element. I will cover these complications later in the chapter: see page 688.)