The JSON that gets generated from the XML will consist only of arrays to support looping within the {{#each}} block used by the templating engine within Hoverfly. It will be exactly the same as the JSON that gets generated in Hoverfly with the jsonpathfromxml function.
This software utilises a fork of https://github.com/basgys/goxml2json with a modification to reflect everything as an array so that the resulting json can be iterated over using {{#each}}.
Where test.xml contains
<lineitems>
<lineitem>
<upc>1</upc>
</lineitem>
<lineitem>
<upc>2</upc>
</lineitem>
<lineitem>
<upc>3</upc>
</lineitem>
</lineitems>Will return to the console (in a single line):
{
"lineitems": [
{
"lineitem": [
{
"upc": [
"1"
]
},
{
"upc": [
"2"
]
},
{
"upc": [
"3"
]
}
]
}
]
}