Being an Oracle DBA, I am quite used to writing routines to generate code for me. On my latest project (a software re-write of an app into .NET / C# code), some consultants on the team recommended using CodeSmith.
We have moved our standard templates for triggers and packages to using CodeSmith, and now they are thinking about using PLINQO (http://plinqo.com) – I think I will have to take a serious look at it.