
When the XML parser reads the document in Listing 7.1, it recognizes that
the top-level element is named
products. Therefore, it constructs an object
to represent the products element.
The next element is a product. The parser creates another object to repre-
sent the product element. Because this is a tree, it attaches the product
object to the products object.
The next element is a name. Again, the parser creates an object for the name
and adds it to the tree being built.
In the name, there is some text that the parser translates in another object
in the tree.
After the name comes a price element, which also contains some text. The
parser adds two new ...