JSON != XML
The short answer is that there isn’t a 1:1 mapping between XML and JSON. This means that there isn’t a function f : XML Document —> JSON Object such that ((f)-1) . f = f . ((f)-1) = id
that's why i opted to go with a simple one-way JSON-to-XML pattern. it doesn't every *try* to go the other way. instead, web authors use hand-crafted XSLT to create JSON output from internal XML (of any kind). this makes for a bit more work, but cuts out a *huge* load of trundling and sweating over getting a consistent round-tripping of XML and JSON. not gonna happen.