XQuery is a powerful and convenient language that is designed for querying the data in XML documents. In this paper, we address how to optimally query encrypted XML documents using XQuery, with the key point being how to eliminate redundant decryption so as to accelerate the querying. We propose a processing model that can automatically and appropriately translate the XQuery statements for encrypted XML documents. Furthermore, we show that XML schema is significantly associated with queries over XML documents. The implementation and experimental results demonstrate the practicality of the proposed model. Keyword: XML, XQuery, DSL, Security, Database.