File inFile = new File("input.docx"); File outFile = new File("output.docx"); WordprocessingMLPackage template = WordprocessingMLPackage.load(new FileInputStream(inFile)); List> data = new ArrayList>(); Map map = new HashMap(); map.put(new DataFieldName("ih1_status"), "Turtle"); data.add(map); org.docx4j.model.fields.merge.MailMerger.setMERGEFIELDInOutput(org.docx4j.model.fields.merge.MailMerger.OutputField.KEEP_MERGEFIELD); System.out.println(XmlUtils.marshaltoString(template.getMainDocumentPart().getJaxbElement(), true, true)); template = org.docx4j.model.fields.merge.MailMerger.getConsolidatedResultCrude(template, data); System.out.println(XmlUtils.marshaltoString(template.getMainDocumentPart().getJaxbElement(), true, true)); template.save(outFile);