Improve UnionXmlCodec error reporting