Large XML documents which are stored in an XML database can be transformed further by an XSL processor using an XSLT stylesheet. In order to answer an XPath query based on the transformed XML document, it may be of considerable advantage to retrieve and process only that part of an XML document stored in the database which is used by a query. Our contribution uses an XSLT stylesheet to transform a given XPath query such that the amount of data which is retrieved from the XML database and transformed by the XSL processor according to the XSLT stylesheet is reduced.