I have an XML file which has the following format -
<root>
<tag>
This is the first Value.
</tag>
<tag>
This is the second Value.
</tag>
</root>
When I convert this XML string to JSON in Python using the following code
jsonString=json.dumps(XML_String)
The tag becomes an array and the JSON file I get is like this -
{"root":["tag":"This is the first Value",
"tag":"This is the second Value"]}
What I actually want is the <root> tag should be an object instead of an array. Like this -
{"root":{"tag":"This is the first Value",
"tag":"This is the second Value"}}
How to achieve such kind of format?