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 said path statistics, a cardinality of a row set of a path-based table construct identified within a query, wherein the row set of said path-based table construct is produced by evaluating a path-based table function within the query, and wherein each row of the row set is produced based on evaluating a path expression against input data to said path-based table function; wherein the method is performed by one or more computing devices.