ME: refactored implementation of get_field_xpath function