parses XML responses correctly