How to convert flat json object into hierarchical xml?

It would be a lot easier if you have the JSON and XML structures actually match instead of defining completely different structures for each.

You don’t even have the names of each field matching between the two.