Reworked XML scan.

The original implementation was not suitable for adding the other XPath axes than 'child' and 'descendant'.