Use the XML to JSON Converter to convert and correctly format message payloads in either direction.
Simply copy and paste your sample message payload in the field, and click to convert.
The Format option will correct any format issues. Note that using this tool as a JSON Formatter is highly recommended as almost ‘invisible’ issues in a payload can break your integration. As an example, if you are configuring using a Macbook the ‘Double Quotation’ marks style on a Mac may not be valid in a JSON file. You can set the style on a Macbook for these quotation marks to save time (instructions here https://osxdaily.com/2014/04/10/change-quote-style-mac-os-x/).