I have the following XML:
<test>
<a></a>
<a><a1><c type="5"/></a1></a>
<a><a2><a1><c type="5"/></a1></a2></a>
<a><a2><a1><c/></a1></a2></a>
<a><c type="6"/></a>
</test>
I want to select all a nodes that have c[@type = '5'] among its children, or grandchildren, or grandgrand..children, i.e. anywhere in the hierarchy. How can I do that?
One of the solution: