toDetox() on JS, to turn haxe Xml into Detox

This just does a simple xml.toString().parse(), plus a null check.

So it may occasionally return things differently (if x was a document
node, etc), but it more or less does the job