This paper discusses the problem of content adaptation for mobile devices. The adaptation considers the context of the client and also the environment where the client request is received. A device independent model is defined and used in order to achieve automatic adaptation of the content based on its semantic and the capabilities of the target device. Our system includes a context description model and a client repository and offers device contexts management and querying functions. The proposed system uses the XQuery language to query the profiles and delivers the results in the form of SOAP services.