Building own "Apply JSON Transformation" Assertion

Document ID : KB000097319
Last Modified Date : 25/05/2018
Show Technical Document Details
While not quite default XML format, so the default "Apply JSON Transformation" does not apply.

So need to code a custom answer for it. 

The Gateway Policy is attached. 

Here is an explaination of the code. 

We set our variable as the JSON array with values : 

Then evaluate JSON Path Expression, which returns an array of results : 
User-added image

Then we loop through the array building up the XML structure : 
User-added image

And to test it we fire off a request : 
User-added image

And get the response in the XML (or other) format we wanted: 
User-added image
File Attachments: