There are three basic approaches for XML to docx:
parse your XML (using DOM or SAX); for each el element, create a w:p, and for each text element, create w:r/w:t
use XSLT to convert your XML to:
WordML, then use that as the main document part in a docx, OR
Flat Open XML, then convert the Flat Open XML to a docx
use the import XHTML stuff (XML + CSS)
Approach 3 is best if you have CSS for your XML, which you'd like reflected in your docx.
Whether you use approach 1 or 2 depends only on which you are more comfortable with. With approach 1, all maintenance would be in Java. With approach 2, some of your code is XSLT.
docx4j will facilitate which ever approach you'd prefer