In the development of agent applications, interactions are an important issue, which must be faced with appropriate methodologies and tools. A separation of concerns between the agents and their interaction needs is helpful in the designing and the implementation phases of the life cycle. In this paper we propose XRole, a system that helps in dealing with interactions. It is based on the definition of roles, which are intended as intermediaries between the application needs and the environment needs. XRole is realized exploiting the interesting features of the XML language. An application example shows the effectiveness of the approach.