There was a developerWorks DataPower forum thread asking how to process XML and JSON backend responses in a service and generate a combined XML respoonse. I did answer with a bigger posting containing a 6.0.1 domain backup of a demo service:
Processing JSON in XSLT can be done "as string" or via conversion to JSONX since years.
XQuery (with JSONiq extensions) can natively process XML as well as JSON.
GatewayScript can natively process JSON, and with ≥184.108.40.206 firmware natively XML as well.
Customer was on 220.127.116.11 and therefore GatewayScript was no option (≥18.104.22.168).
Solution I provided used XSLT to do backend calls by <dp:url-open> and store results into context variables, and then XQuery script to nicely combine the responses in XQuery (see above forum posting for details):