private String renderPasteHtml(Editor editor) {
ReadableDocumentView<ContentNode, ContentElement, ContentTextNode> view =
editor.getContent().getRenderedView();
System.out.println("doc: " + XmlStringBuilder.innerXml(view).toString());
ContentElement topLevelElement = view.getDocumentElement().getFirstChild().asElement();
assertEquals(LineContainers.topLevelContainerTagname(), topLevelElement.getTagName());
Point<ContentNode> start = Point.inElement(topLevelElement, topLevelElement.getFirstChild());
Point<ContentNode> end = Point.<ContentNode> end(topLevelElement);
Element fragment =
PasteFormatRenderer.get().renderTree(view, topLevelElement,
new SelectionMatcher(start, end));