How can I efficiently select all nodes of type x that are not children of a node of type x?
Example with type as p:
<p id="top1">
<ul>
<li>Text</li>
<li>Text</li>
<li>Text</li>
</ul>
<div>
<p id="sub">
<p id="sub_sub">
</p>
</p>
</div>
</p>
<div>
<div>
<p id="top2">
</p>
</div>
</div>
The select should only return nodes with ids top1 and top2
Like this: