ancestor::div selects all div ancestors of the context node <?xgrep-match [xgrep-test1.xml]--------------------------------?> <div><para name="para1b"/></div>