I was thinking about the element indexing issue and a possible quick solution comes to mind. It would be something of a hideous hack, but I suspect that it would be much easier to implement than a new kind of index.
The idea would be (if this indexing option were selected) to invisibly add a new attribute to each element; perhaps named "_elname_", something which is unlikely to clash with a normally used name (of course the name should be documented and known to avoid). The attribute would then be defined as:
<ELEMENT _elname_="ELEMENT" ...>
where ELEMENT was any particular string. e.g. every <page ...> would become <page _elname_="page" ...>
If my thought is correct, then every reference to an element could then be invisibly replaced with:
ELEMENT[@_elname_="ELEMENT"]
which is effectively an identity assuming that the attribute exists for each element. This would seem to work whether the element is referenced alone or with additional predicates. The goal here would be to use the existing attribute indices to speed up finding those elements.
I haven't tried it yet with the Wikipedia example but I have noticed that searches which do use indices execute very rapidly, as would be expected.
There may be some lethal flaw, but I'd like the opinions of the BaseX developers on this approach.