The innermost node of type B has a child of type D . We can add that to the list of node types that can be children of type B . The node of type D has three children of type E . This concept is illustrated in the following listing, which is a very abbreviated version of the complete XML file. In this case, the content of the root node defines three elements named Q , B , and B , so they are children of the root node.
Text constitutes a special kind of node, often referred to as a text node.
So, the answer to the above question is that the node named Q does have one child, and it is a text node . Note that in my manual tree representation of the XML file in Figure 1, I didn't represent text nodes in the same way that I represented the other types of nodes. I did it this way so that the entire tree could be contained in a reasonable vertical space. Adding text nodes using the same representation as the other nodes caused the tree to be almost twice as tall, and, in my opinion, makes it more difficult to analyze visually. As one more example of a conversion from raw XML notation to tree notation, let's take a look at the raw XML code that represents the very bottom node of type B in the tree of Figure 1.