Assuming Dragon
defines at least a superset of the properties and fields that apple
does then competent_tech's answer is appropriate though I think your question is actually asking about:
[System.Xml.Serialization.XmlType("apple")]
public class Dragon
If Dragon
is not compatible with apple
then you may be better off performing an explicit conversion between the types. Assuming your application knows the definition of both apple
and Dragon
, this can be accomplished by deserializing your apple
stream to an apple
object, mapping the properties to a new Dragon
object, and then serializing your Dragon
object.