Hi Nick!
I actually tried using the XML node for it, but got an error response.
The input was a JSON string, I now tried to parse it>
msg.payload = JSON.parse(msg.payload);
and then the XML node was happy about it.
I noticed that the response back to the client (a web browser in this case) was incomplete (cut off in the middle).
Whilst a console.log showed the correct and entire XML.
I added this to set the content length header before returning from the flow, and then the client received the entire XML.
msg.headers['Content-Length'] = Buffer.byteLength(msg.payload, ['utf8']);
msg.headers['Content-Type'] = 'text/xml; charset=UTF-8';
Cheers
-jo