private static void UnmarshallResult(XmlUnmarshallerContext context,GetBucketNotificationResponse response)
        {
            
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;
            
            if (context.IsStartOfDocument) 
               targetDepth += 2;
            
            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("TopicConfiguration", targetDepth))
                    {
                        response.TopicConfigurations.Add(TopicConfigurationUnmarshaller.GetInstance().Unmarshall(context));
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }

            return;
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context,GetBucketNotificationResponse response)
        {
            
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;
            
            if (context.IsStartOfDocument) 
               targetDepth += 2;
            
            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("TopicConfiguration", targetDepth))
                    {
                        response.TopicConfigurations.Add(TopicConfigurationUnmarshaller.Instance.Unmarshall(context));
                        continue;
                    }
                    if (context.TestExpression("QueueConfiguration", targetDepth))
                    {
                        response.QueueConfigurations.Add(QueueConfigurationUnmarshaller.Instance.Unmarshall(context));
                        continue;
                    }
                    if (context.TestExpression("CloudFunctionConfiguration", targetDepth))
                    {
                        var cfc = CloudFunctionConfigurationUnmarshaller.Instance.Unmarshall(context);
                        if (cfc == null || cfc.IsSetInvocationRole())
                        {
                            response.CloudFunctionConfigurations.Add(cfc);
                        }
                        else
                        {
                            var lfc = new LambdaFunctionConfiguration
                            {
                                FunctionArn = cfc.CloudFunction,
                                Events = cfc.Events,
                                Id = cfc.Id
                            };
                            response.LambdaFunctionConfigurations.Add(lfc);
                        }
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }

            return;
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) 
        {   
            GetBucketNotificationResponse response = new GetBucketNotificationResponse();
            response.TopicConfigurations = new List<TopicConfiguration>();

            while (context.Read())
            {
                if (context.IsStartElement)
                {                    
                    UnmarshallResult(context,response);                        
                    continue;
                }
            }
                        
            return response;
        }