We will now look at another use of the DOM API to modify the contents or structure of the XML. Unlike SAX, DOM provides a number of methods that allow nodes to be added, deleted, changed, or replaced in the DOM tree. Table 16.10 summarizes these methods.
|appendChild(Node newNode)||Adds the new node to the end of the NodeList of children of this node.|
|cloneNode(boolean deep)||Returns a duplicate of a node. The cloned node has no parent. If deep is true, the whole tree below this node is cloned; if false, only the node itself is cloned.|
|insertBefore(Node newNode,||Inserts the newNode before Node refNode)the existing refNode.|
|removeChild(Node oldNode) ...|