Assuming Dragon defines at least a superset of the properties and fields that apple does, then the competent answer is consistent, although I think your question really asks:
[System.Xml.Serialization.XmlType("apple")] public class Dragon
If Dragon not compatible with apple , you might be better off doing an explicit conversion between types. Assuming your application knows the definition of both apple and Dragon , you can accomplish this by deserializing the apple stream to an apple object, mapping properties to the new Dragon object, and then serializing your Dragon .
source share