I don't think this is as robust as 'true' code generator tools, but worth looking into:
http://www.dotnetjunkies.com/Article/74851895-C4D4-4F11-956D-A27D849E4A62.dcik