descendant-or-self::para selects the para element descendants of the context node and, if the context node is a para element, the context node as well <?xgrep-match [xgrep-test1.xml]--------------------------------?> <para name="para1" type="zzz"> something <div><para name="para1b"/></div> </para> <?xgrep-match [xgrep-test1.xml]--------------------------------?> <para name="para1b"/> <?xgrep-match [xgrep-test1.xml]--------------------------------?> <para name="para2" type="warning"/> <?xgrep-match [xgrep-test1.xml]--------------------------------?> <para name="lastPara" type="warning"/>