Convert execute_xpath_expr to take a callback and pointer