My XML Structure is like
<root>
<elem1>..</elem1>
<elem1>..</elem1>
*<elem1>..</elem1>*
<elem2>
<elem1>..</elem1>
<elem1>..</elem1>
¬ <elem1>..</elem1> ¬
</elem2>
</root>
I need to select the last elem1 of the immediate child of root (marked with * *).
I want to do it in QueryPath - http://querypath.org. But JQuery syntaxes could also help.
$root->find('elem1')->last();
$root->find('elem1:last);
$root->find('elem1:last-child);
All the above three selects the elem1 marked with ¬