CLP(Flex): Constraint Logic Programming Applied to XML Processing. In this paper we present an implementation of a constraint solving module, CLP(Flex), for dealing with unification in an equality theory for terms with flexible arity function symbols. Then we present an application of CLP(Flex) to XML-processing where XML documents are abstracted by terms with flexible arity symbols. This gives a highly declarative model for XML processing yielding a substantial degree of flexibility in programming.