Added XML parse error handling.