Documentation implements IDocumentation { @Override public void setStringContent(String content) { Node domNode = documentation.getDomNode(); XMLUtil.removeAllSubNodesExceptAttributes(domNode); Text textNode = domNode.getOwnerDocument().createTextNode(content); domNode.appendChild(textNode); } Documentation(TDocumentation wrappedDocumentation); List<Node> getDocumentationElements(); @Override String getStringContent(); Element addDocumentationElement(QName name); Element addDocumentationElement(String namespaceURI, String localName); @Override void setStringContent(String content);  }
@Test public void testSetStringContent() throws Exception { documentation.setStringContent("abc"); assertEquals("abc", documentation.getStringContent()); assertEquals(1, documentation.getDocumentationElements().size()); documentation.setStringContent("def"); assertEquals("def", documentation.getStringContent()); assertEquals(1, documentation.getDocumentationElements().size()); }