XML VS JSON
XML - Extensible Markup Language
JSON is more lighter and efficient than XML
JSON does not provide any display capabilities because it is not a document markup language.
XML’s strength is extensibility and the avoidance of namespace clashes. It holds any data type and can be used to transport full documents with formatting information included. XML is best used when transporting something like a patient chart or text document with markup included.
XML provide display capabilities.
XML structures are based on elements (which can be nested), attributes (which cannot), raw content text, entities, DTDs, and other meta structures.
JSON is a better data exchange format. XML is a better document exchange format. Use the right one for the right job.