1. A method comprising: a database server running on one or more computers; said database server receiving a first database statement; wherein the first database statement requires access to a view defined as combined results of a set of database statements; wherein the first database statement includes an expression that operates on an XML construct; and said database server generating a second database statement, based on the first database statement and the view, that includes a modified version of the set of database statements in the distributive form and rewritten to include the expression that operates on the XML construct.