Skip to main content
Serialize: XML The Serialize: XML mapper converts a data structure like objects and arrays into an XML formatted string.

Fields

Root element name

Determines the root level XML tag used in the generated XMLstring. By default, `response` is used.

Sample data

InputRoout element nameOutput
{“name”: “Example”,“price”: 19.95}response”<?xml version=\“1.0\”?>\n<response><name>Example</name><price>19.95</price></response>”
{“invoiceId”: “#1234”,“totalAmount”: 300,“products”: [{“sku”: “ABC”,“price”: 100,“qty”: 1},{“sku”: “123”,“price”: 200,“qty”: 1}]}Invoice”<?xml version=\“1.0\”?>\n<Invoice><invoiceId>#1234</invoiceId><totalAmount>300</totalAmount><products><sku>ABC</sku><price>100</price><qty>1</qty></products><products><sku>123</sku><price>200</price><qty>1</qty></products></Invoice>”
[“A”, “B”, “C”]Product”<?xml version=\“1.0\”?>\n<Product><item key=\“0\“>A</item><item key=\“1\“>B</item><item key=\“2\“>C</item></Product>”