Remove old invalid XML handler

Towards #433.
Count XML errors more gracefully

Towards #433.