Besides being adopted as the new interchange format for the Internet, XML is finding increasing acceptance as a native data repository language. In order to make XML repositories fully equipped with data management capabilities, suitable query and update languages are being developed. However, once the user is allowed to perform updates, it is perceivably necessary to guarantee the correctness of his/her updates, especially if document validity or semantic constraints are violated. We address this problem by exploiting the well-grounded concept of active rules. In this paper, we propose Active XQuery, an active language for XML repositories that is based on a previously defined XQuery update model. In particular, we present the syntax and semantics of our language, aiming at emulating the trigger definition and execution model of SQL3. An active extension of XQuery arises nontrivial problems, related to the need of interleaving updates and triggers. These problems have led us to defin...