A powerfull templating facility is included in jOpenDocument.
You start by creating a template file, directly in OpenOffice, with the help of the jOpenDocument AddOn.
It lets you quickly insert all the grey and green spans you see below.
You start by creating a template. You can then define values that you need in you document. Either by using setField(), or by using showParagraph()/hideParagraph(). Finally you just call saveAs().
The final document will look like:
If you want to know more about templates, look at the package org.jopendocument.dom.template