1. A computer-implemented method comprising the steps of: maintaining path statistics for a collection of XML documents; wherein, for each path expression of a set of path expressions, said path statistics indicate at least a node-count statistic, which comprises a number of nodes within said collection that is satisfied by said path expression; and estimating, based on the path statistics, a cardinality for a path-based table construct, wherein the path-based table construct is produced by evaluating a path-based table function within a query.