1. A method of forming a document model for constructing a semantically and syntactically valid document, the method comprising the steps of: beginning with a root tag, creating a tag element corresponding to a tag in the document to be constructed, the tag element including information relating to the corresponding tag; associating one or more model elements with the tag element, each model element being a child of the tag element and representing an alternative to the information relating to the corresponding tag; and for each of the one or more model elements, generating a semantically and syntactically valid sub-tree of elements as a child of the one or more model elements based at least in part upon a structure of the document to be constructed under one or more predetermined conditions.