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 ≥220.127.116.11 firmware natively XML as well.
Customer was on 18.104.22.168 and therefore GatewayScript was no option (≥22.214.171.124).
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):