protected void cloneNode(CoreDocumentImpl newdoc, boolean deep) {
public Node cloneNode(boolean deep) {
    protected void cloneNode(CoreDocumentImpl newdoc, boolean deep) {        // clone the children by importing them        if (needsSyncChildren()) {            synchronizeChildren();        }        if (deep) {            Hashtable reversedIdentifiers = null;            if (identifiers != null) {                // Build a reverse mapping from element to identifier.                reversedIdentifiers = new Hashtable();                Enumeration elementIds = identifiers.keys();                while (elementIds.hasMoreElements()) {                    Object elementId = elementIds.nextElement();                    reversedIdentifiers.put(identifiers.get(elementId),                    elementId);                }            }            // Copy children into new document.            for (ChildNode kid = firstChild; kid != null;            kid = kid.nextSibling) {                newdoc.appendChild(newdoc.importNode(kid, true, true,                reversedIdentifiers));            }        }        // experimental        newdoc.allowGrammarAccess = allowGrammarAccess;        newdoc.errorChecking = errorChecking;    } // cloneNode(CoreDocumentImpl,boolean):void