The object we work with is OMDOMReader dom0Reader = new OMDOMReader( CurrentNode ); OMObject m0Object = dom0Reader.readObject(); out.println("The OM object is " + m0Object.toString()); //out.println("Make the replacement "); Node newTree = myDocument.importNode( fTree , true ); CurrentNodeParent.replaceChild( newTree,CurrentNode); //out.println("Is " + newTree+"="+CurrentNode+" ?"); // Check the result OMDOMReader domReader = new OMDOMReader( myDocument ); OMObject mObject = domReader.readObject(); out.println("The new document (containing the tree) is " + mObject.toString()); The new tree DIFFERS from the old one! OMDOMReader dom8Reader = new OMDOMReader( fChild1 ); OMObject m8Object = dom8Reader.readObject();