My question is very specific and I hope that someone has done this conversion from HTMLto DOCX.
To do this I took a sample code from github and tried it in my local Ecli
check code here. Api used is docx4j-ImportXHTML. Code is simple to follow. Just pass on your xhtml to api as in code and it will do the needful.