The POI library can generate DOC files, but it's no longer maintained; it may work for your purposes, though. As an alternative, iText can create RTF files. And there's also OpenOffice, which has a Java API, but a sizeable learning curve. You'll find links to all these on the AccessingFileFormats wiki page.
Ping & DNS - updated with new look and Ping home screen widget