adding some debug information for malformed xml docs