You may have element with values (children or attributes) that must be unique within some context.
Other elements may refer to those values.
Ideally, you'd like your schema to describe these constraints so they can be enforced.
This is what XML Schema's keys are used to accomplish.