appendChildren(firstChildId, last, getPath(), newContent, true);
appendChildren(firstChildId, new NodeImplRef(last), getPath(), newContent, true);
    public void update(NodeList newContent)            throws DOMException {        final NodePath path = getPath();        final DocumentImpl prevDoc = new DocumentImpl(ownerDocument);        // remove old child nodes        NodeList nodes = getChildNodes();        NodeImpl child, last = this;        long firstChildId = firstChildID();        int i = nodes.getLength();        for (; i > 0; i--) {            child = (NodeImpl) nodes.item(i - 1);            if (child.getNodeType() == Node.ATTRIBUTE_NODE) {                firstChildId = child.gid + 1;                last = child;                break;            }            if (child.getNodeType() == Node.ELEMENT_NODE)                path.addComponent(child.getQName());            removeAll(child, path);            if (child.getNodeType() == Node.ELEMENT_NODE)                path.removeLastComponent();        }        ownerDocument.broker.endRemove();        children = i;        // append new content        appendChildren(firstChildId, last, getPath(), newContent, true);        ownerDocument.broker.update(this);        // reindex if required        ownerDocument.broker.reindex(prevDoc, ownerDocument, null);    }