It is often the case that XML documents contain information of different sensitivity degrees that must be selectively shared by user communities. This paper presents the XXACF (eXtensible Role-Based XML Access Control Framework) framework for controlling access to XML documents in different environments. The proposed access control model of XXACF is described. The framework represents an improvement over the existing systems and enables defining context-sensitive access control policies on different priority and granularity levels, the enforcement of access control for different operations on XML documents, as well as different ways of access control enforcement for the same operation.