schema validation inspired by XMLSchema