This is my json value:
{
"hello": [
{
"names": {
"name": "abc"
}
},
{
"names": {
"name": "def"
}
}
]
}
I tried using XML.toString(new JsonObject()), and this is what I get:
<hello>
<names>
<name>abc</name>
</names>
</hello>
<hello>
<names>
<name>def</name>
</names>
</hello>
Whereas, the xml I expected was this:
<hello>
<names>
<name>abc</name>
</names>
<names>
<name>def</name>
</names>
</hello>
This unexpected behaviour results in an invalid XML error, since there is no root element now. What am I missing here?
XML.toString(new JsonObject())?