1. A method for exporting at least a portion of a relational database to an XML document, comprising the steps of: obtaining an initial view query that defines an XML view on a relational database and an XSLT stylesheet specifying at least one transformation; modifying said initial view query to account for an effect of said at least one transformation; and applying said modified view query to said relational database to obtain said XML document.