How to automate or convert JSON into Katalon XML(variables script mode)

I want to automata the process of converting the JSON to XML which will be used in Test case variables ( script mode)

If you are willing to write some lines in Katalon Studio Test Case, it can convert a JSON into XML. See, for example,

However, as you see, the solution is NOT automatic at all. I do not think there is a “generic tool” to convert a JSON to a XML. You need to help yourself.


I tried, works well

import groovy.json.JsonSlurper
import groovy.xml.MarkupBuilder

def json = '''
    "name": "sampleConfiguration",
    "description": "SampleDesc",
    "version": "1.0",
    "parameters": [
        "name": "sampleParameter",
        "description": "parameter description",
        "value": "20",
        "enabled": "1"
        "name": "items",
        "description": "parameter with subparameters",
                "name": "item",
                "description": "nested parameter",
                "value": "13"
                "name": "item",
                "description": "nested parameter 2",
                "value": "TEST"

def xml = new JsonSlurper().parseText(json).with { j ->
	new StringWriter().with { sw ->
		new MarkupBuilder(sw)."$name"(version: version, description:description) {
			params {
				parameters.each { p ->
					if(p.value instanceof List) {
						"$"(description:p.description) {
							p.value.each { v ->
								"$"(description: v.description, v.value)
					else {
						"$"(description:p.description, p.value)

println xml

<sampleConfiguration version='1.0' description='SampleDesc'>
    <sampleParameter description='parameter description'>20</sampleParameter>
    <items description='parameter with subparameters'>
      <item description='nested parameter'>13</item>
      <item description='nested parameter 2'>TEST</item>

Thank you.