I just blogged a few days ago on doing Nested (or MasterTemplates) here

http://www.divergingpath.com/index.c...ting-functions