Temply is a tool wich lets you produce files from a template. You ca use some transformations defined in xml files, and a script in a scripting language called Groovy (http://groovy.codehaus.org), which prompt the user to decide the transformations that must occurs.
It can be used (and has been created originally) to produce application descriptor for java web containers.
It is written in java and needs a 1.4 JRE to run. This is Open Source software, licensed under the GNU General Public License.
In the first place, I hoped to resolve all with configuration files, but I have found it too complicated, so I have introduced the script engine. I hope this project can be helpful, but for now you must configure all with text files, and sometimes can be confusing to get what you need, but it works for me and I hope it works even for you.