Reorder so xml is parsed before xpath, so errors are more helpful
Make XML parse error message a bit clearer