Added method to count elements which match a given xpath