Apache FreeMarker is a free Java-based template engine, originally focusing on dynamic web page generation with MVC software architecture. It can now generate text based on templates and changing data. It has no dependency on servlets or HTTP or HTML.
It is often used for generating source code, configuration files or e-mails.