thanks silbert, this is not it
the problem with text template is the only way to write them out is with template.execute. i dont wanna do that as it will stop being a template after that function. anyways, i think I figured it out, so will close the thread.
solution: use the root.nodes and iterate through them to save the template in a file.
thanks for your help. have a nice day.