text.clear();
    private void startNode(int nodeNr, NodePath currentPath) {        if (doc.nodeKind[nodeNr] == Node.ELEMENT_NODE) {            ElementImpl elem = new ElementImpl(1);            if(stack.empty()) {                elem.setNodeId(broker.getBrokerPool().getNodeFactory().createInstance());                initElement(nodeNr, elem);                stack.push(elem);                broker.storeNode(transaction, elem, currentPath);                targetDoc.appendChild(elem);                elem.setChildCount(0);            } else {                ElementImpl last = (ElementImpl) stack.peek();                initElement(nodeNr, elem);                last.appendChildInternal(prevNode, elem);                stack.push(elem);                broker.storeNode(transaction, elem, currentPath);                elem.setChildCount(0);            }            prevNode = null;            currentPath.addComponent(elem.getQName());            storeAttributes(nodeNr, elem, currentPath);        } else if (doc.nodeKind[nodeNr] == Node.TEXT_NODE) {            ElementImpl last = (ElementImpl) stack.peek();            text.setData(new String(doc.characters, doc.alpha[nodeNr], doc.alphaLen[nodeNr]));            text.setOwnerDocument(targetDoc);            last.appendChildInternal(prevNode, text);            prevNode = text;            broker.storeNode(transaction, text, null);            text.clear();        } else if (doc.nodeKind[nodeNr] == Node.COMMENT_NODE) {            CommentImpl comment = new CommentImpl(new String(doc.characters, doc.alpha[nodeNr],                     doc.alphaLen[nodeNr]));            comment.setOwnerDocument(targetDoc);            if (stack.empty()) {                comment.setGID(1);                broker.storeNode(transaction, comment, null);                targetDoc.appendChild(comment);            } else {                ElementImpl last = (ElementImpl) stack.peek();                last.appendChildInternal(prevNode, comment);                prevNode = comment;                broker.storeNode(transaction, comment, null);            }        } else if (doc.nodeKind[nodeNr] == Node.PROCESSING_INSTRUCTION_NODE) {            ProcessingInstructionImpl pi = new ProcessingInstructionImpl();            pi.setOwnerDocument(targetDoc);            QName qn = (QName)doc.namePool.get(doc.nodeName[nodeNr]);            pi.setTarget(qn.getLocalName());            pi.setData(new String(doc.characters, doc.alpha[nodeNr], doc.alphaLen[nodeNr]));            if (stack.empty()) {                pi.setGID(1);                broker.storeNode(transaction, pi, null);                targetDoc.appendChild(pi);            } else {                ElementImpl last = (ElementImpl) stack.peek();                last.appendChildInternal(prevNode, pi);                prevNode = pi;                broker.storeNode(transaction, pi, null);            }        }    }