I want to be able to serialize
class A {
Base Prop{ get; set; }
}
class B:Base { [XmlText] string Foo {get;set; }
class C:Base { [XmlText] string Bar {get;set; }
to
<A>
<Prop>
<B>blah</B>
</Prop>
</A>
However, the default behavior gives me
<A>
<Prop xsi:type="B">blah</Prop>
</A>
So basically, I want to discriminate type of the property's value by nesting an element instead of using xsi:type.
Is it possible to do with XML serialization attributes, or do I have to resort to IXmlSerializable?