Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XSLT Developer's Guide

Deciding whether to Use IDs or Keys

The XML specification itself provides a simple means to uniquely identify an element, using an ID-type attribute. A conforming XML processor, such as the MSXML processor, is expected to build an index of any elements with IDs, enabling them to be cross-referenced. They might be cross-referenced, for example, by other elements with a corresponding IDREF-type attribute.

Why, then, does the XSLT standard provide keys for essentially the same purpose? There are several drawbacks to using IDs alone:

The use of keys enables an XSLT style sheet to circumvent any or all of these restrictions.