According to the W3C authority, the DOM is designed to allow programs and scripts to dynamically access and update the contents, structures, and styles of documents. Some of these features were discussed in Chapter 10. In fact almost any elements in an HTML/XHTML document can be accessed, modified, deleted, or added by using the DOM’s features. To do this, the DOM must have an internal representation of the entire page. More precisely, inside the DOM each document has a logical structure, or representation, that is very much like a tree.
For example, if an XHTML document is a big tree, then the following XHTML table in ex11-01.txt can be considered as a branch of the tree: