I tried to read various textbooks on the Internet, but I cannot succeed in solving this problem, which is easy to describe, but I can not imagine a solution.
Here is an example XML:
<AAA>
<BBB>
<CCC>1</CCC>
<CCC>2</CCC>
</BBB>
<BBB>
<CCC>3</CCC>
<CCC>4</CCC>
</BBB>
</AAA>
I want to be able to select the last one <CCC>in each container ... in other words, I want to be able to pull <CCC>2</CCC>and <CCC>4</CCC>. I tried countless expressions to achieve this, but the best thing I can do is get the last one <CCC>(which contains 4).
It looks like // BBB / CCC [last ()] should work, but apparently it selects all CCCs that are children of BBB (total 4), and only then processes the last () predicate - and only for that returns one element <CCC>4</CCC>
! - ? !