Improve XML detection in adaptive mode.