Abstract. Schema mappings play a central role in both data integration and data exchange, and are understood as high-level specifications describing the relationships between data schemas. Based on these specifications, data structured under a source schema can be transformed into data structured under a target schema. During the transformation some structural constraints, both context-free (the structure) and contextual (e.g. keys and value dependencies) should be taken into account. In this work, we present a new formalism for the schema mapping specification. We propose a new class of tree-pattern formulas in order to extend semantics of XML schema mappings by specification of key constraints and value dependencies. We discuss foundations of the method and propose a key-preserving transformation algorithm.