Implemented the ability to derive a template from a parse tree.