Learn XSLT
XSLT is a formidable technology to transform XML. If working with XML, XSLT is very useful.
The command line tool: xsltproc
can be recommended.
In regards to JavaScript implementation:
The first one is no actively maintained, the latter should be used.