1. A computer program stored on a non-transitory computer-readable medium, the program comprising: instructions which produce a customised document for which inclusion of document content from a template is based on evaluation of rules, the rules being evaluated using values assigned to content variables of the template, wherein the values are based on responses to questions of a questionnaire, comprising: receiving a completed questionnaire and defining a dataset of content variables for which values have been assigned; forming a dependency network in which conditions indicate relationships between dependent content variables and controlling content variables of the template; determining which content variables of the template are relevant by defining ones of the content variables as relevant if, and only if, the content variable as represented in the dependency network: (i) is not one of the dependent content variables, or (ii) is one of the dependent content variables and all associated controlling content variables are relevant and all associated conditions evaluate to either true or indefinite; defining the dataset as complete if, and only if, all relevant content variables of the template are in the dataset; and where received responses are insufficient to evaluate all rules, generating a fully customised document if the dataset is complete.