I would refine this to say “don’t try to generically convert XML/JSON.” Conversion is fine if you apply the usual “hints” for properly parsing XML, such as doc type, XSD or the arrays/makeArrays input to xmlNodeToDocument. One of the big lies of XML is that it is “self-describing.”
In many ways, it is. But in multiple important ways it is decidedly not.
Although XML has no explicit definition of null, there is a widely accepted and defined way. xsi:nil is used to indicate a valid element with no content even if that elements content type normally doesn’t allow empty elements. An empty tag is not null – it is an empty value, which is different from null. In some languages/environments, empty is equivalent to null but that assumption is not a safe one in XML.
If one is using wM IS for brokering the interaction between 2 applications, there certainly is good case for it. Accept XML from a caller, convert that to JSON to call the provider, then reverse it on the way back. This indeed is one of the core aspects of using an integration tool. 
But I think we agree – generic translation between XML/JSON might work for rather simple data documents. But anything with even a little bit more than just a flat set of fields will quickly fail in some scenarios. Proceed with extreme caution. And in any case, I strongly recommend NOT using the XML/JSON transformation feature of API GW. It will very likely bite you at some point.
#API-Gateway#API-Management#webMethods#Integration-Server-and-ESB