A practical framework for representing knowledge and reasoning in the domain of Unified Modeling Language (UML) is proposed. In this framework, graphical diagrams in a UML model are encoded as Extensible Markup Language (XML)/Metadata Interchange (XMI) elements, which are regarded as facts about a specific problem instance in a knowledge base, and the general knowledge on UML, such as inherent interrelationships among diagram components and implicit properties of diagrams, is represented as a set of XML definite clauses. Equivalent transformation (ET) is used as a fundamental computation mechanism for reasoning with the represented diagrams. © 2004 Wiley Periodicals, Inc.