Abstract: An environment for composing software permits the separation of control functions from information about the context in which the control functions operate. The software composition environment is used to make a system which will translate XML documents into models and vice-versa. The translation system is used to translate an XML document having one DTD into an XML document having another DTD by translating the first XML document into a model representing the semantics of the XML document and translating the model into the second XML document (2005). The system for translating XML documents into models employs a general technique for translating any XML documents into a mirror model (2107) that reflects the structure of the XML document and a general technique of using tag pattern models (2109) to obtain information from one model and using it to make or modify another model.