Default behaviour of JSON to XML serialization is arrays elements appear on the same level as non-array elements. Like on example from https://www.newtonsoft.com/json/help/html/ConvertJsonToXml.htm :
{
'Email': 'james@example.com',
'Active': true,
'CreatedDate': '2013-01-20T00:00:00Z',
'Roles': [
'User',
'Admin'
]
}
is serialised into
<Root>
<Email>james@example.com</Email>
<Active>true</Active>
<CreatedDate>2013-01-20T00:00:00Z</CreatedDate>
<Roles>User</Roles>
<Roles>Admin</Roles>
</Root>
But I need XML array in the form
<Roles>
<Item>User</Item>
<Item>Admin</Item>
</Roles>
How could I achieve this?
Thanks in advance.