Eliminated unnecessary searches for descendant nodes.
Renamed 'empty' attribute of XMLScanData structure to 'done. That's more universal: the resulting node set may be non-empty and yet we may need to indicate that it no longer makes sense to continue searching.