A document is represented by a tree t, and a schema is represented by a tree-regular language L. Document transformation is defined as a composition of a marking function m/sub C//sup P/ and a linear tree homomorphism h, where P is a pattern and C is a contextual condition.