The cloneNode method allows you to copy a node or hierarchy of nodes that do not retain references to their originating DOM Document.
If you wish to clone a single node, do this:
$myClone =& cdCollection->documentElement->cloneNode();
This will return a single node named "cdLibrary". If you also want to clone all subnodes of a node, pass a value of true to the method:
$myDeepClone =& cdCollection->documentElement->cloneNode(true);
This will return the entire node hierarchy of the cd library.
|