Programmatically convert odf to docx

I have a Java application using https://odftoolkit.org/ that does something like this:

File file = new File("Foo.odt");
OdfTextDocument odt = OdfTextDocument.newTextDocument();
// [snip adding of content]
odt.save(file);
odt.close(); 

Where a odt document is created, however what i would like to do is :

File file = new File("Foo.docx");
OdfTextDocument odt = OdfTextDocument.newTextDocument();
// [snip adding of content]
odt.exportDocx(file); // <-- This Made up to illustrate the idea.
odt.close(); 

As LibreOffice can do this, I expect that the routines are somewhere, but cannot find where.

Note: I would rather not make a system call to libreOffice, or especially open the document manually

Sorry, but it seems strange to me that you are asking a question here, but “would rather not make a system call to libreOffice”. Why don’t you ask this question on the Development Mailing List of that project? Or, if it’s about docx, maybe they will answer you on that forum