Patent ID: 7210096

Claim:
A method of forming a document model for automatically constructing a semantically and syntactically valid document, the method comprising the steps of: beginning with a root tag, creating a plurality of tag elements corresponding to respective tags in the document to be constructed, each of the plurality of tag elements including information relating to a corresponding one of the tags; associating one or more model elements with each of the tag elements, each model element being a child of an associated tag element and representing an alternative to the information relating to the corresponding tag, each of the model elements being distinct from the respective associated tag elements and being operative to capture semantic information of the corresponding respective tags, each of the one or more model elements associated with each of the tag elements representing a different semantic component of the corresponding tag, each model element having at most one tag element as a parent; 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.