Я пишу функцию сериализации, которая должна определить, имеет ли класс атрибут DataContract. В основном функция будет использовать DataContractSerializer, если класс имеет атрибут DataContract, в противном случае он будет использовать XmlSerializer.
Спасибо за вашу помощь!