Python library and cli tool for converting XML to JSON
$ poetry add xmltojson
$ pip install xmltojson
$ xmltojson <filename.xml>
$ xmltojson <filename.xml> -o <new_filename.json>
$ echo '<name>John</name>' | xmltojson --stdin
[1]: import xmltojson
[2]: with open('/path/to/file', 'r') as f:
...: my_xml = f.read()
[3]: xmltojson.parse(my_xml)
'{"name": "John"}'