* @param cursor Cursor to write results out to.
* @param recurse Whether or not to write children to the operation.
*/
public static <N, E extends N, T extends N> void buildDomInitializationFromElement(
ReadableDocument<N, E, T> doc, E element, DocInitializationCursor cursor, boolean recurse) {
cursor.elementStart(doc.getTagName(element), new AttributesImpl(doc.getAttributes(element)));
if (recurse) {
for (N child = doc.getFirstChild(element); child != null; child = doc.getNextSibling(child)) {
buildDomInitializationFromSubtree(doc, child, cursor);
}
}