Various people are using docx4j for document generation, but I'm not aware of anyone having ported flexdoc.
Having had a quick look at it, I think you could port it easily enough. That said, unless I needed an identical solution running on Java, I'd probably do some of it a little differently:
1. As the site mentions, there's the i4i patent issue. See
http://blogs.technet.com/gray_knowlton/ ... -word.aspx for more on this.
2. I'd use sdt's (content controls) for what flexdoc calls If, ForEach, and ValueOf.
WordML has a natural mechansim for implementing value-of; this is reflected in docx4j (see
http://dev.plutext.org/trac/docx4j/brow ... nding.java ).
If and ForEach can also be implemented using w:sdt/w:stdPr/w:tag; you need a convention for interpreting the w:tag.
Hope this helps .. Jason