public static CacheBehaviorUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new CacheBehaviorUnmarshaller();
            }

            return(instance);
        }
        public CacheBehaviors Unmarshall(XmlUnmarshallerContext context)
        {
            CacheBehaviors cacheBehaviors = new CacheBehaviors();
            int            originalDepth  = context.CurrentDepth;
            int            targetDepth    = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Quantity", targetDepth))
                    {
                        cacheBehaviors.Quantity = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Items/CacheBehavior", targetDepth))
                    {
                        cacheBehaviors.Items.Add(CacheBehaviorUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(cacheBehaviors);
                }
            }



            return(cacheBehaviors);
        }