// create op, wrapping the tree operations within retains.
DocOpBuffer opBuffer = new DocOpBuffer();
safeRetain(opBuffer, position);
DomOperationUtil.buildDomInitializationFromSubtree(localDoc, localNode, opBuffer);
safeRetain(opBuffer, remainder);
DocOp op = opBuffer.finish();
// fake out the node creation, and consume:
nodeCreationDelegate =
new ReadableTreeWalker<ContentNode, ContentElement, ContentTextNode>(localDoc, localNode);
sink.consume(op);