9. An XML database management system (XDBMS) for generating at least one index over XML documents in an XML database, the system comprising: at least one processor configured to execute at least one indexing function that takes as input an XML document and returns at least one computed result; and a non-transitory computer readable storage medium configured to store: at least one library module comprising the at least one indexing function defined in the XQuery language, each said indexing function being configured to accept an XML document as input and to return at least one computed result; the at least one computed result from the at least one indexing function as a key of the corresponding index, wherein the at least one indexing function is configured to return at least one XML substructure and wherein the at least one processor is further configured to map each said XML substructure onto a tuple of type values and to store each of the tuples as a key of the index.
9. An XML database management system (XDBMS) for generating at least one index over XML documents in an XML database, the system comprising: at least one processor configured to execute at least one indexing function that takes as input an XML document and returns at least one computed result; and a non-transitory computer readable storage medium configured to store: at least one library module comprising the at least one indexing function defined in the XQuery language, each said indexing function being configured to accept an XML document as input and to return at least one computed result; the at least one computed result from the at least one indexing function as a key of the corresponding index, wherein the at least one indexing function is configured to return at least one XML substructure and wherein the at least one processor is further configured to map each said XML substructure onto a tuple of type values and to store each of the tuples as a key of the index. 11. The system of claim 9 , wherein the at least one processor is further configured to bind the library module to at least one collection of XML documents in the XML database.