What is XML?
XML is a markup language, similar to HTML, but without predefined tags. It can be used to hold any kind of structured data. While HTML is designed to display data, XML is designed to carry data.
HTTP responses from REST APIs are often in either JSON or XML format; however, JSON is more common and easier to read.
XML handles data in two ways:
-
Tags: Tags are "markup" that hold content. Tags start with
<
and end with/>
(usually). -
Attributes: Attributes indicate some property about data (metadata).
Info
The "X" in XML stands for "Extensible," meaning that XML is a data format that is flexible and customizable.
Sources
- MDN Web Docs
- Learn API Technical Writing: JSON and XML for Writers by Peter Gruenbaum
- W3 Schools