In the proposed data model for XML databases, an XML element is directly represented as a ground (variable-free) XML expression—a generalization of an XML element by incorporation of variables for representation of implicit information and enhancement of its expressive power—while a collection of XML documents as a set of ground expressions, each describing an XML element in the documents. Axioms and relationships among elements in the collection as well as structural and integrity constraints are formalized as XML clauses. An XML database, consisting of: (i) a document collection (or an extensional database), (ii) a set of axioms and relationships (or an intensional database), (iii) a set of integrity constraints, is therefore modeled as an XML declarative description comprising a set of ground XML expressions and XML clauses. Its semantics is a set of ground XML expressions, which are explicitly described by the extensional database or implicitly derived from the database, based ...