Trees: The Basic Structure of XML

In Chapter 1, we talked about XML as a markup language and used it to display information on a page. In this capacity, it's little more than text—albeit specifically structured text. In actuality, there's much more to that structure than just neatness.

At its heart, XML is data. It might not be reader-friendly data, but it is data. And for data to be readable by something as simple-minded as a computer—as opposed to the human brain—it has to be organized logically.

In XML, we call this structure a tree. Each tree has a root, branches, and leaves, and each serves a specific purpose.

I can't stress enough how important it is to understand this. Just about every single thing we do from here on is going to involve ...

Get XML and Java™ from scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.