I am new to docx4j. Currently doing a POC for docx4j. It would be very good if some one could help me out. I ran through many sites but i am not able to understand why an xml file is being used instead of .java file. I need to replace the place holders from a template.docx file into another Sample.docx file. I am able to replace text but only some keys are replaced with values. Everything is the same but not sure what is happening. Also i need to replace a text in the header from the same template.docx file to the Sample.docx file. Can anyone help me on this. Please help me out with simple sample files and also please explain me why many people are using xml files.