add a test to make sure that repeated xpath queries on the same document aren't slow.
fix issue #741.