Is your feature request related to a problem? Please describe.
When executing code similar to the following:
annotation = SomeOtherType(feature=sub_annotation, ...)
cas.add(annotation=annotation)
cas.to_xmi("example.xmi")
the sub_annotation needs to be manually added to the cas (cas.add(annotation=sub_annotation)). If this isn't done, the resulting xmi is invalid because cassis won't set the sofa feature in the sub_annotation. However, there is no error message.
Describe the solution you'd like
cas.to_xmi() should be able to catch errors like this and determine if an xmi is invalid.
Describe alternatives you've considered
cas.typecheck() could also be used for this. Currently it only checks uima.cas.FSArray.