You are asking for the opposite of https://github.com/plutext/docx4j/blob/ ... n/Doc.java
In principle, you could do that using docx4j and POI's HWPF (or indeed with just POI, using its XWPF). But it would be a lot of work for a complete solution.
You could see whether the latest release of LibreOffice gives you acceptable results. If so, drive it from Java using JODConverter.
Otherwise, try Google for other solutions. Plutext also has a commercial component in development which could help, but its not available quite yet.