optimize XMLFormatter
count all errors