You will need to apply XPath expressions more than one time, first to obtain the list of
<createnew> nodes wherever they occur, then separately (in a loop) for each node that you just found.
libxml2 is an industry-standard binary implementation of XML, used by most languages for their XML support, therefore all of the many
XPath tutorials that can be found on the web apply to it. Any example that you find for another programming language will apply directly to Perl, too, if you are using this module.