i've got an id attribute value for an element.
i want to select only its children (not all descendants).
i used
$childElements = $xml->xpath('//entity[@id=212323]');
print_r($childElements);
but that would select ALL descendants and print them out. i just want to select the 1 generation children. how could i do that?
<entity id=212323>
<this>asd</this>
<this>asd</this>
<this>asd</this>
<this>
<notThis>asd</notThis>
<notThis>asd</notThis>
<notThis>asd</notThis>
</this>
</entity>
(cause the hierarchy is very long, so fecthing all descendants would slow the process down, and its not smart to fetch unnecessary data).