public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            if (reader.IsEmptyElement) {
                reader.ReadStartElement();
                return;
            }

            reader.ReadStartElement();
            while (!reader.EOF) {
                if (reader.IsStartElement()) {
                    switch (reader.Name) {
                        case "Atlas":
                            XmlSpineAtlasElement atlas = new XmlSpineAtlasElement();
                            atlas.ReadXml(reader);
                            Atlas = atlas;
                            break;

                        case "Skeleton":
                            XmlSpineSkeletonElement skeleton = new XmlSpineSkeletonElement();
                            skeleton.ReadXml(reader);
                            Skeleton = skeleton;
                            break;

                        case "AnimationMap":
                            XmlSpineAnimationMapElement animationMap = new XmlSpineAnimationMapElement();
                            animationMap.ReadXml(reader);
                            AnimationMap = animationMap;
                            break;

                        case "ActivityMap":
                            XmlActivityMapElement activityMap = new XmlActivityMapElement();
                            activityMap.ReadXml(reader);
                            ActivityMap = activityMap;
                            break;

                        default:
                            reader.Skip();
                            break;
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement) {
                    reader.ReadEndElement();
                    break;
                }
                else
                    reader.Read();
            }
        }
        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            if (reader.IsEmptyElement) {
                reader.ReadStartElement();
                return;
            }

            reader.ReadStartElement();
            while (!reader.EOF) {
                if (reader.IsStartElement()) {
                    switch (reader.Name) {
                        case "Instance":
                            XmlDirectionalAnimationSetInstance instance = new XmlDirectionalAnimationSetInstance();
                            instance.ReadXml(reader);
                            Instance = instance;
                            break;

                        case "Sprites":
                            XmlSpriteListElement sprites = new XmlSpriteListElement();
                            sprites.ReadXml(reader);
                            Sprites = sprites;
                            break;

                        case "AnimationSets":
                            ReadAnimationSetsXml(reader);
                            break;

                        case "ActivityMap":
                            XmlActivityMapElement activityMap = new XmlActivityMapElement();
                            activityMap.ReadXml(reader);
                            ActivityMap = activityMap;
                            break;

                        default:
                            reader.Skip();
                            break;
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement) {
                    reader.ReadEndElement();
                    break;
                }
                else
                    reader.Read();
            }
        }