1. A computer implemented method, comprising: executing a dynamic document template having access only to variables in its local namespace and variables passed by an application through arguments to the dynamic document template, wherein the dynamic document template is physically separate from the application, in which executing dynamic document template comprises calling the separate dynamic document template scripts which comprise the dynamic document template from more than one application program, in which calling the dynamic document template comprises generating an interim script, and in which the method further comprises the step of deleting the interim script after generating the document; generating a script from the dynamic document template; and creating a document based, in part, on the script by executing procedural statements of the script to generate document records, wherein the document comprises document records without the procedural statements.