1. A method comprising:receiving a schema as an input;
for at least one element in the schema:
parsing the element from the schema;
validating the parsed element by comparing the parsed element to a node within a first schema parse tree;
generating, using a processor, a parse tree node for the parsed element, the parse tree node configured to call at least one validation rule, external to a second schema parse tree, which validates an element of a document corresponding to the parse tree node; and
adding the parse tree node to the second schema parse tree; and
outputting the second schema parse tree.