Document doc2 = newDocument(id1).setPrimaryType("nt:unstructured").setParent(parentId).document();
documentsById.put(id2, doc2);
documentsByLocation.put(pathStr + "/generated-out", doc2);
DocumentWriter parentWriter = writeDocument(entry.getValue());
parentWriter.addChild(id1, "generate");
parentWriter.addChild(id2, "generated-out");
Document parent = parentWriter.document();
documentsById.put(readDocument(parent).getDocumentId(), parent);
documentsByLocation.put(pathStr, parent);
}