Next, the document can be validated. The ordering, naming and nesting of tags, and type of data that appears within each tag, can be compared against rules described in a separate grammar file.