I am having an xml document of this form:
<root>
<item title="x">
<children/>
</item>
<item title="y">
<children>
<item title="y1">
<children/>
</item>
<item title="y1">
<children>
<item title="y1.1">
<children/>
</item>
</children>
</item>
</children>
</item>
</root>
and so on. Normally I would parse recursively the file for every node and see if the node has children or not to do some extra html formatting. The problem with this schema is that the children appear even if it is single entry (header of a single chapter for example) or empty.
I am using php and xpath, how can I know that the item/children/ of each node has no children so that I would apply a special formatting?