more robust handling of XML errors for two classes