Chapter 4. Sending and Receiving Data
In This Chapter
Generating an XML response
Working with XML
eXtensible Markup Language (XML) is an extremely useful tool for sending and receiving data. XML data is easy to read and understand, even by humans. It's not too difficult to write programs that can read XML data, and the structure of the data is preserved by the tags. When you create your own XML format, you define custom tags to describe the data as follows:
<person> <name> <first>John</first> <middle>L</middle> <last>Doe</last> </name> <age>25</age> <gender>Male</gender> </person>
XML is nothing new if you've read any other part of this book. XHTML is simply a form of HTML that also follows XML rules. The new idea is this: Rather than having to conform to somebody else's list of tags, you can invent your own and transmit information using your custom XML syntax.
Every XML element ...