=Index Rewritings=
A major feature of BaseX is the ability to rewrite all kinds of query patterns for [[Indexes|database index access]]. The following queries are all equivalent. They will all be rewritten to exactly the same query that will eventually access the text index of a <code>factbook.xml</code> database instance (the file included in our full distributions):
<syntaxhighlight lang="xquery">