From XML to JSON
XMLSerializer treats each element as a string unless a type parameter is specified.
JSONFunction needs an additional parameter that specifies that function's params.
All xml attributes will have the prefix '@' and text nodes will have the property name '#text'. XMLSerializer supports the rules outlined at Converting Between XML and JSON
XML input Code
CAUTION: when parsing, JSONObject and JSONArray will check for cycles in the hierarchy, throwing an exception if one is found. You can change this behavior by registering a CycleDetectionStrategy.