The W3C Published XML in 1998 to Make Any Software Talk to Any Other. It Worked. That Is Why You Still Need It.
The W3C Published XML in 1998 to Make Any Software Talk to Any Other. It Worked. That Is Why You Still Need It.
In February 1998, the World Wide Web Consortium published a specification for a markup language that claimed it could make any software communicate with any other software. The language was XML, Extensible Markup Language, and the ambition was substantial for its time: a universal format for structured data exchange that any system, in any programming language, on any operating system, could read and write without prior arrangement.
The promise largely delivered. For most of the late 1990s and 2000s, XML dominated data exchange, configuration files, document formats, and web services. SOAP, the Simple Object Access Protocol built on XML, became the standard mechanism by which enterprise systems communicated across organizational boundaries. Then JSON arrived and displaced XML for most new development. JSON is smaller, easier to read, and directly native to JavaScript. New APIs are almost universally JSON.
XML did not disappear. The need to convert between the two formats reflects decades of accumulated infrastructure that was not designed around the same standards as current development.
The motivation for XML came from the complexity of SGML, Standard Generalized Markup Language, the ISO standard from which HTML was also derived. SGML was powerful and could define any document structure, but implementing a full SGML parser was a significant engineering project. Most software that needed document or data exchange capabilities could not realistically adopt SGML.
The W3C formed an XML Working Group in 1996 to build a simplified subset that preserved SGML's essential capabilities while reducing its complexity. The specific design goals, as stated in the XML 1.0 specification, included that XML should be usable over the internet, that XML documents should be human-readable, that XML design should be formal and concise, and that the number of optional features in XML should be kept to an absolute minimum.
XML 1.0 was published on February 10, 1998. It defined a standard syntax for structured documents: elements delimited by angle-bracket tags, attributes within opening tags, and arbitrary nesting of elements within elements. The standard syntax meant that any XML parser could read any conforming XML document without knowing in advance what the document contained.
What XML did not define was what any particular document should contain. That was left to schemas, defined separately using DTD (Document Type Definition) or later XSD (XML Schema Definition). The schema describes which elements and attributes are valid, in what combinations, and with what data types. An XML document that conforms to a published schema can be validated by any XML parser without additional code.
Douglas Crockford extracted JSON from JavaScript's object literal syntax in 2001 as the minimum viable format for moving structured data between a server and a browser. The design was deliberately minimal: objects, arrays, strings, numbers, booleans, and null. No attributes. No namespaces. No mixed content. No schema system built in.
The minimal design produced advantages that XML could not match for web development. A JSON object parsed directly into a JavaScript value with no intermediate representation. JSON payloads for equivalent data were typically 40 to 60 percent smaller uncompressed. JSON required no namespace declarations or schema references. A JavaScript developer could read and write JSON without learning a separate specification.
The REST architectural style, which gained momentum in the mid-2000s as an alternative to SOAP, favored JSON. REST APIs using JSON became the default for new development by around 2010. The HTTP Archive's tracking of API response formats shows JSON firmly dominant for new web services by the early 2010s.
This shift did not make XML obsolete. It made XML the format of existing systems rather than new ones.
The healthcare industry standardized on XML before JSON existed and has not migrated. HL7 v2.x, the messaging format used in hospitals and clinical systems worldwide, and CCD (Continuity of Care Document) formats use XML. FHIR, the newer healthcare data standard, supports both JSON and XML representations, but many existing healthcare integrations use the XML form.
Financial services similarly retain substantial XML infrastructure. The Financial Information eXchange (FIX) protocol, used for electronic trading, uses a tag-value format that predates XML but has XML schema representations. XBRL, the eXtensible Business Reporting Language used for financial reporting to regulators including the SEC, is an XML-based format. Insurance and banking back-office systems built on SOAP web services from the 2000s communicate in XML because their interfaces have not been rebuilt.
Government systems are another major source of XML in active use. Federal agencies including the IRS, Social Security Administration, and HHS maintain SOAP-based XML interfaces for data exchange with external parties. State-level systems add further XML infrastructure. A vendor integrating with any of these systems needs to produce conforming XML.
Enterprise resource planning software from major vendors including SAP and Oracle maintains XML interfaces for data import, export, and integration, both for legacy reasons and because XML's schema system provides strong data type validation useful for financial and inventory data.
Converting JSON to XML is not a mechanical substitution. The two formats represent structured data using fundamentally different models.
JSON provides objects, which are unordered collections of key-value pairs, and arrays, which are ordered sequences. An array in JSON is expressed with square brackets and can contain values of any type. There is no named container concept other than the object.
XML provides elements, which are named containers that can contain other elements, text, or both. Elements can carry attributes, which are name-value pairs embedded in the opening tag. XML supports namespaces, which allow elements from different schemas to coexist in a single document without naming conflicts. XML allows mixed content, where an element contains both text and child elements interleaved.
None of JSON's structures map cleanly to all of XML's structures. A JSON array has no direct XML equivalent, because XML does not have an array type. Array elements are typically represented in XML as repeated sibling elements with the same tag name. A JSON property might become an XML element or an XML attribute depending on the target schema. A JSON value that is a string might map to element text content or to an attribute value.
Different JSON-to-XML conversion tools make different choices about these mappings and often use different naming conventions. Some prefix array item elements with the array key name. Some use a generic wrapper element. These choices affect whether the output validates against a specific XML schema that the receiving system expects.
The conversion need arises in several specific scenarios.
The most common is integration work between modern services and legacy enterprise systems. A new application generates data in JSON and must submit it to a legacy SOAP endpoint that accepts only XML. Converting the JSON to the expected XML structure at the integration boundary is the standard approach.
Configuration testing is another use case. Some older software tools and build systems use XML configuration files. Developers who prefer to work in JSON sometimes convert to XML as a final step before feeding files to tools that require it.
Debugging and inspection is a third scenario. An XML document from a legacy system can be converted to JSON to make it easier to inspect in JavaScript development tools, which have strong JSON visualization but weaker XML visualization. The reverse direction, JSON to XML, serves developers who need to construct test XML documents and find it easier to draft the structure in JSON before converting.
Conclusion
XML's 1998 promise to make any software talk to any other software succeeded in a way that created lasting infrastructure. Healthcare, finance, government, and enterprise systems built on that promise are still running, still exchanging XML, and still requiring partners and integrations to speak the same format.
For converting JSON structures to XML in the browser, ToolHQ's JSON to XML converter handles the element and attribute mapping decisions and produces well-formed XML output that can be inspected, tested, and adapted for the target system.
Frequently Asked Questions
When was XML published and why?
The W3C published XML as a recommendation in February 1998. It was designed to be a universal format for structured data exchange, allowing any software system to communicate with any other regardless of programming language or platform.
Why do enterprise systems still use XML when JSON is newer?
Systems built in the 1990s and 2000s were designed for XML and SOAP. Replacing working infrastructure is expensive. Healthcare, finance, insurance, and government systems continue using XML-based protocols like SOAP, HL7, and FIX.
Is there a direct mapping between JSON and XML?
Not a complete one. XML has features, including attributes, namespaces, and mixed content, that JSON does not support. Converting between them requires decisions about which XML features to use for each JSON structure.