Fix bug in detecting whether an object response is xml