You can use the 'xmltodict' or 'ElementTree' libraries. The process roughly looks like this: first parsing XML into in Python dictionary or data structure, and then converting that structure to JSON. This makes it easy to work with data from XML in JSON format in your program. You can also find out more info at this link
How can I convert XML to JSON using Python? This is the first time I am encountering this. I need to accomplish this task, but I don't know where to start or what libraries to use.