fix xml parse leak memory and detect gzip support