The schema is King.
It defines the rules by which the document can be considered valid.
But the King is smart and flexible and knows a date or integer from a string.
He is also flexible by allowing partial validity, wildcards, a composition of documents.
His rules are complex but precise.
But cross him in the wrong context and he'll throw you in the dungeon.
Lesson: Validity against a flexible schema language is good and applications can demand that input be valid.