As discussed on IRC, can't think of a valid situation where there are nested paragraphs with no dividing root (e.g., draw:frame). Re-added the common code, and tweaked so it always stops iteration as soon as it finds an accepted node.