using System; using System.Collections.Generic; using System.Text; using System.Xml.Serialization; namespace XmlParserByAttribute { [XmlRoot("cats")] public class CatCollection { [XmlElement("cat")] public List Cats { get; set; } = new List(); } [XmlRoot("cat")] public class Cat { [XmlAttribute("color")] public string Color { get; set; } [XmlElement("saying")] public string Saying { get; set; } [XmlAttribute("animType")] public AnimationType animationType; } public enum AnimationType { Wrap, Loop } }