listener = broker.getIndexController().getStreamListener();
newNode = appendChild(transaction, oldNode.nodeId, new NodeImplRef(previous),
getPath(), newChild, listener);
//Reindex if required
final DocumentImpl owner = (DocumentImpl)getOwnerDocument();
broker.storeXMLResource(transaction, owner);
broker.updateNode(transaction, this, false);
broker.getIndexController().reindex(transaction, reindexRoot, StreamListener.STORE);
broker.flush();
} catch (final EXistException e) {
LOG.warn("Exception while inserting node: " + e.getMessage(), e);