Getting started with XML
The Extensible Markup Language (XML) is a way of representing hierarchical data in a standard text format. When working with XML-based web APIs, we'll be creating XML documents and sending them as the bodies of HTTP requests and receiving XML documents as the bodies of responses.
Here's the text representation of an XML document, perhaps this represents the stock at a cheese shop:
<?xml version='1.0'?> <inventory> <cheese id="c01"> <name>Caerphilly</name> <stock>0</stock> </cheese> <cheese id="c02"> <name>Illchester</name> <stock>0</stock> </cheese> </inventory>
If you've coded with HTML before, then this may look familiar. XML is a markup based format. It is from the same family of languages as HTML. The data is structured in an hierarchy formed by elements. Each element is represented by two tags, a start tag, for example, <name...