In a state-of-the-art XML database, an XML query is evaluated as a sequence of structural joins in which positions of data nodes are used to perform each individual structural join. In this paper, we define the notion of social classes of data nodes and present a framework of query evaluation in which both positions and social classes of data nodes are used with structural joins to further improve query performance. A social class of a data node is defined as an equivalence class induced by tags of other nodes that are associated with the given node in a given structural relation. In our framework, social classes of data nodes are obtained during data loading. Then during query compilation, queries are analyzed to determine required structural relations among query nodes and to derive required social classes for each individual query node. The positions of data nodes, the social classes of data nodes, and the required social classes of query nodes are used during query evaluation to...