XML to JSON merges tags <p>I am working on a small project and I have encountered an issue for which I cannot find a solution myself or locate something similar on internet. So, I am retrieving information from API in XML format, when I call my own API through JavaScript to retrieve this XML document the data gets converted into JSON format, but the repeating tags get merged into single property. Anyone know how I can stop it ?</p> <p>Here is some Sample data:</p> <pre><code>&lt;then&gt; &lt;test operator="test"&gt; &lt;one&gt; &lt;byte&gt;1&lt;/byte&gt; &lt;/one&gt; &lt;two&gt; &lt;byte&gt;1&lt;/byte&gt; &lt;/two&gt; &lt;/test&gt; &lt;insert&gt; &lt;object&gt; &lt;string&gt;1&lt;/string&gt; &lt;/object&gt; &lt;/insert&gt; &lt;remove&gt; &lt;object&gt;url&lt;/object&gt; &lt;/remove&gt; &lt;test operator="test"&gt; &lt;one&gt; &lt;byte&gt;3&lt;/byte&gt; &lt;/one&gt; &lt;two&gt; &lt;byte&gt;3&lt;/byte&gt; &lt;/two&gt; &lt;/test&gt; &lt;/then&gt; </code></pre> <p>After serialization the output would look like this:</p> <pre><code>{ "then": { "test": [ { "one": { "byte": "1" }, "two": { "byte": "1" }, "_operator": "test" }, { "one": { "byte": "3" }, "two": { "byte": "3" }, "_operator": "test" } ], "insert": { "object": { "string": "1" } }, "remove": { "object": "url" } } } </code></pre> <p>You can see that all test have been merged into 1 property. Is there any way to stop this ?</p>