broker.index(newNode);
broker.index(newNode, newNode.getPath());
	public void updateChild(Node oldChild, Node newChild) throws DOMException {		if (!(oldChild instanceof NodeImpl))			throw new DOMException(				DOMException.WRONG_DOCUMENT_ERR,				"node does not belong to this document");		NodeImpl old = (NodeImpl) oldChild;		NodeImpl newNode = (NodeImpl) newChild;		NodeImpl previous = (NodeImpl) old.getPreviousSibling();		if (previous == null)			previous = this;		if (oldChild.getNodeType() == Node.ELEMENT_NODE) {			// replace the document-element			if (newChild.getNodeType() != Node.ELEMENT_NODE)				throw new DOMException(					DOMException.INVALID_MODIFICATION_ERR,					"a node replacing the document root needs to be an element");			broker.removeNode(old, old.getPath());			broker.endRemove();			newNode.gid = old.gid;			broker.insertAfter(previous, newNode);			broker.index(newNode);			broker.flush();		} else {			broker.removeNode(old, old.getPath());			broker.endRemove();			newNode.gid = 0;			broker.insertAfter(previous, newNode);		}	}