>Thanks for the link. I'll look at it.
I forgot to say that Nettiers is open source but it uses the codegenerator Codesmith (which is not free), but codesmith can generate all sorts of code, not only .net.
I found that
www.mygeneration.com seems to do something very similar and that is afaik free.