ElementImpl elem = new ElementImpl(1, ROOT_QNAME);
ElementImpl elem = new ElementImpl(ROOT_QNAME);
    public void store() {    	// create a wrapper element as root node    	ElementImpl elem = new ElementImpl(1, ROOT_QNAME);        elem.setNodeId(broker.getBrokerPool().getNodeFactory().createInstance());    	elem.setOwnerDocument(targetDoc);        elem.setChildCount(doc.getChildCount());        elem.addNamespaceMapping("exist", Serializer.EXIST_NS);        NodePath path = new NodePath();        path.addComponent(ROOT_QNAME);                stack.push(elem);        broker.storeNode(transaction, elem, path);        targetDoc.appendChild(elem);        elem.setChildCount(0);                // store the document nodes        int top = doc.size > 1 ? 1 : -1;        while(top > 0) {            store(top, path);            top = doc.getNextSiblingFor(top);        }                // close the wrapper element        stack.pop();        broker.endElement(elem, path, null);        path.removeLastComponent();    }