Adapt XPATH code to work correctly on windows