I've never needed to use a template processor to generate code. Usually a macro system built into the programming language is better for this. I think template processors are more commonly used for generating text documents.
What problem are you trying to solve?