/// <summary>
        /// See <see cref="INodePolicy.GetAttribute"/> for details.
        /// </summary>
        public override Node GetAttribute(Node node, int index)
        {
            var attributes = node.ObjectType.GetAttributes();

            return(index >= 0 && index < attributes.Length
                                ? new Node(node.Context, MemberNodePolicy.GetPolicy())
            {
                Member = attributes[index]
            }
                                : null);
        }
        /// <summary>
        /// See <see cref="INodePolicy.GetChild"/> for details.
        /// </summary>
        public override Node GetChild(Node node, int index)
        {
            var elements = node.ObjectType.GetElements();

            if (index >= 0 && index < elements.Length)
            {
                var member = elements[index];
                var policy = member.NodePolicy != null
                                        ? node.Context.CreateNodePolicy(member.NodePolicy.NodePolicyType)
                                        : MemberNodePolicy.GetPolicy();

                return(new Node(node.Context, policy)
                {
                    Member = member
                });
            }
            return(null);
        }