public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();

            reader.ReadStartElement();
            while (!reader.EOF) {
                if (reader.IsStartElement()) {
                    switch (reader.Name) {
                        case "AnimationSet":
                            XmlSpineAnimationSetElement animation = new XmlSpineAnimationSetElement();
                            animation.ReadXml(reader);
                            Animations.Add(animation);
                            break;

                        default:
                            reader.Skip();
                            break;
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement) {
                    reader.ReadEndElement();
                    break;
                }
                else
                    reader.Read();
            }
        }
        public void WriteXml(XmlWriter writer)
        {
            foreach (ISpineAnimationSetElement animation in Animations) {
                XmlSpineAnimationSetElement elem = animation as XmlSpineAnimationSetElement;
                if (elem == null)
                    elem = new XmlSpineAnimationSetElement(animation);

                writer.WriteStartElement("AnimationSet");
                elem.WriteXml(writer);
                writer.WriteEndElement();
            }
        }