I am new to XSLT transformation and got stuck with this recursive mapping.
<
This should do the job:
As Tim notes the result is not a valid XML because it has two root elements. To generate an extra root element to make the output valid XML add this template:
root