public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
        {
            if (indexes.Length != 1)
            {
                throw new InvalidOperationException("You may only specify a single index.");
            }

            XmlNode found = null;
            var     s     = indexes[0] as string;

            if (s != null)
            {
                var name = s;
                found = node?.Attributes?[name];
                if (found == null)
                {
                    found = createElement(name);
                    node?.AppendChild(found);
                }
            }
            else if (indexes[0] is int)
            {
                var index = (int)indexes[0];
                found = node?.Attributes?[index];
            }

            if (found != null)
            {
                result = new XmlBuilder(found, createElement, createAttribute);
                return(true);
            }
            result = null;
            return(false);
        }
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            XmlNode found = node[binder.Name];

            if (found == null)
            {
                found = createElement(binder.Name);
                node.AppendChild(found);
            }

            result = new XmlBuilder(found, createElement, createAttribute);
            return(true);
        }