Ricardo, there is no notion of "document hierarchy" in XQuery, a collection is simply a sequence of (document) nodes. Therefore what you want to do is necessarily product-specific. In Qizx, this is quite achievable using extension functions. Xavier Franc http://www.qizx.com/