Docx4JWordTemplate { public PlainTextContent addPlainTextContent() { SdtBlock block = PlainTextContent.createSdtBlockElement(); wordMLPackage.getMainDocumentPart().getContent().add(block); PlainTextContent plainTextContent = new PlainTextContent(block); plainTextContentControls.add(plainTextContent); return plainTextContent; } Docx4JWordTemplate();  Docx4JWordTemplate(InputStream in); PlainTextContent addPlainTextContent(); List<PlainTextContent> getPlainTextContent(); void writeAsOPCXml(OutputStream out); void writeAsOpenXML(OutputStream out); void writeAsPDF(OutputStream out);  }
@Test public void addPlainTextContentTest() throws Docx4JException, JAXBException { Docx4JWordTemplate doc = new Docx4JWordTemplate(); doc.addPlainTextContent(); assertEquals(1, doc.getPlainTextContent().size()); List<Object> content = doc.getWordMLPackage().getMainDocumentPart() .getContent(); assertEquals(1, content.size()); assertTrue(content.get(0) instanceof SdtBlock); assertEquals(1, doc.getPlainTextContent().size()); }