Example:
<ul>
<li>item 1</li>
<ul>
<li>item 2</li>
<li>item 3</li>
<ul>
<li>item 5</li> <!-- context node -->
</ul>
</ul>
<li>item 6</li>
</ul>
If the li element with the text item 5 is the context node, the expression following::* would yield the li element with text item 6. Is there a built-in way to get the difference in depth of these nodes? i.e if we defined the root ul as having depth 0, then it's children (li item 1, ul, li item 6) would have depth 1, and so on. li item 5 has depth 3.
The ancestor axis could be used from both nodes, but wonder if there is another way. Another possibility might be to keep state information when traversing the tree and if the parent had following siblings?