1. A method to estimate a cost for computing a query on XML documents stored in a database, the method comprising the steps of: maintaining a plurality of statistics about nodes in said XML documents; and estimating the cost of computing said query based upon said statistics.