json to xml conversion with root element

Hi I am new to apigee and I am doing JSON to XML conversion using json-xml policy but after conversion policy add two extra tags into data like follows

<?xml version="1.0" encoding="UTF-8"?>
<Root>
converted data
</Root>

but I don't want these two additional tags <?xml version="1.0" encoding="UTF-8"?> and <Root>

so how can I remove these two tags without adding any extra policy to it

Any help would be appreciated.

0 1 1,133
1 REPLY 1

XML is invalid without a root node.

The other tag is known as the XML declaration. It is optional but benign.

If you want to remove the root tag and the declaration, you would have to do some other transformation to the XML such as using extract variables with it.

One thing to note is you can use a different name for your root node by setting the ObjectRootElementName in your policy.