This post is an enhancement from the code by JHEIDT:
http://community.codesmithtools.com/forums/p/5921/23086.aspx#23086
Basically I found the code that was provided was not recognized by the CodeSmith 4.1 Provider Schema API. I made modifications to the code..here are the results...
I had to change the namespace to allow the CodeSmith API to recognize the provider.