Dear Michael,
(d) /TEI (ditto)
This one surprised me, since the TEI element in the document is namespace-qualified, and I would not have expected the expression to match anything.
This was due to a bug in the query optimization step that has recently been fixed. The latest snapshot (and Version 7.3, which will be released in 1, 2 days) will return the expected results:
http://files.basex.org/releases/latest/
Sorry for that, Christian