Hi, after Andreas recommended using index:facets(), my application speeds up. However, I don't think that this is the best solution. The database, I apply this function to is changing constantly. As the function is using the index, I would have to re-create the index first, is this correct? So that the functions would give wrong results most of the time. And I found another strange thing: I had to delete some nodes and re-created all indexes. However, index:facets() still gives the information from the status *before* the deletion, i.e., it counts nodes that aren't there anymore. Therefore I don't use it. count(//entry/selected[text () = "yes"]) gives the correct result, index:facets("collect", "flat")//element[@name = "selected"]/entry[text() = "yes"]/@count/data() still gives the wrong result, i.e., the result that was correct some days ago. Is this a bug or a feature? Best regards Cerstin -- Dr. phil. Cerstin Mahlow Universität Basel Departement Sprach- und Literaturwissenschaften Fachbereich Deutsche Sprach- und Literaturwissenschaft Nadelberg 4 4051 Basel Schweiz Tel: +41 61 267 07 65 Fax: +41 61 267 34 40 Mail: cerstin.mahlow@unibas.ch Web: http://www.oldphras.net