ME: refactored 'get_field_xpath' to use a recursive function
ME: made code more clean