C# 生成 xml中包含xsi:type=“CD“

xml格式为ObservationValuexsi:type="CD"症状描述 按照如下定义类: [System.SerializableAttribute()

xml格式为ObservationValuexsi:type="CD"症状描述
按照如下定义类:

    [System.SerializableAttribute()][System.ComponentModel.DesignerCategoryAttribute("code")][System.Xml.Serialization.XmlTypeAttribute(AnonymousType = false, Namespace = "urn:hl7-org:v3")][XmlInclude(typeof(CD))]public class ObservationValue{      }public class CD : ObservationValue{}

一定要new CD();并且AnonymousType = false 这个必须为false