public static object Deserialize(XNode node)
        {
            string type = node.Attribute("type");

            switch(type)
            {
                case "string":
                    return node.Attribute("value");

                case "int":
                    return int.Parse(node.Attribute("value"));

                case "float":
                    {
                        var value = node.Attribute("value");

                        if (value == "max")
                        {
                            return float.MaxValue;
                        }

                        if (value == "min")
                        {
                            return float.MinValue;
                        }

                        return float.Parse(value, CultureInfo.InvariantCulture);
                    }

                case "double":
                    {
                        var value = node.Attribute("value");

                        if (value == "max")
                        {
                            return double.MaxValue;
                        }

                        if (value == "min")
                        {
                            return double.MinValue;
                        }

                        return double.Parse(value, CultureInfo.InvariantCulture);
                    }

                case "long":
                    return long.Parse(node.Attribute("value"));

                case "bool":
                    return bool.Parse(node.Attribute("value"));

                case "dateTime":
                    return DateTime.Parse(node.Attribute("value"), CultureInfo.InvariantCulture);
            }

            return null;
        }
        public static bool DeserializeEnum(XNode node, Type enumType, out object value)
        {
            string type = node.Attribute("type");

            if(type == "enum")
            {
                try
                {
                    value = Enum.Parse(enumType, node.Attribute("value"));
                    return true;
                }
                catch
                {}
            }

            value = null;

            return false;
        }