When it comes to converting XML to JSON and vice versa, there are two major conventions, one named "Badgerfish" and the other, “Mapped.” The main difference between these two conventions exists in the way they map XML namespaces into JSON.
This XML string can be converted into JSON as follows.
- Using “Badgerfish”
- Using “Mapped”
If we use the namespace mapping as-> foo
Learn more information about JSON here.