/// <summary>
            /// Get indexed nodes by index name and key value.
            /// </summary>
            /// <param name="indexName">Index name</param>
            /// <param name="value">Key value</param>
            /// <returns>Indexed nodes</returns>
            public XPathNodeIterator GetNodes(string indexName, object value)
            {
                if (!indexed)
                {
                    BuildIndexes();
                }
                XPathNavigatorIndex index = (XPathNavigatorIndex)indexes[indexName];

                return(index == null? null : index.GetNodes(value));
            }
            /// <summary>
            /// Adds new key to the named index.
            /// </summary>
            /// <param name="navigator">XPathNavigator over XML document to be indexed</param>
            /// <param name="indexName">Index name</param>
            /// <param name="key">Key definition</param>
            public void AddKey(XPathNavigator navigator, string indexName, KeyDef key)
            {
                indexed = false;
                nav     = navigator;
                //Named indexes are stored in a hashtable.
                if (indexes == null)
                {
                    indexes = new Dictionary <string, XPathNavigatorIndex>();
                }

                if (!indexes.TryGetValue(indexName, out XPathNavigatorIndex index))
                {
                    index = new XPathNavigatorIndex();
                    indexes.Add(indexName, index);
                }
                index.AddKey(key);
            }
            /// <summary>
            /// Adds new key to the named index.
            /// </summary>
            /// <param name="nav">XPathNavigator over XML document to be indexed</param>
            /// <param name="indexName">Index name</param>
            /// <param name="key">Key definition</param>
            public void AddKey(XPathNavigator nav, string indexName, KeyDef key)
            {
                this.indexed = false;
                this.nav     = nav;
                //Named indexes are stored in a hashtable.
                if (indexes == null)
                {
                    indexes = new Hashtable();
                }
                XPathNavigatorIndex index = (XPathNavigatorIndex)indexes[indexName];

                if (index == null)
                {
                    index = new XPathNavigatorIndex();
                    indexes.Add(indexName, index);
                }
                index.AddKey(key);
            }
 /// <summary>
 /// Adds new key to the named index.
 /// </summary>
 /// <param name="nav">XPathNavigator over XML document to be indexed</param>
 /// <param name="indexName">Index name</param>
 /// <param name="key">Key definition</param>
 public void AddKey(XPathNavigator nav, string indexName, KeyDef key)
 {
     this.indexed = false;
     this.nav = nav;
     //Named indexes are stored in a hashtable.
     if (indexes == null)
         indexes = new Dictionary<string, XPathNavigatorIndex>();
     XPathNavigatorIndex index;
     if (!indexes.TryGetValue(indexName, out index))
     {
         index = new XPathNavigatorIndex();
         indexes.Add(indexName, index);
     }
     index.AddKey(key);
 }
			/// <summary>
			/// Adds new key to the named index.
			/// </summary>
			/// <param name="nav">XPathNavigator over XML document to be indexed</param>
			/// <param name="indexName">Index name</param>
			/// <param name="key">Key definition</param>
			public void AddKey(XPathNavigator nav, string indexName, KeyDef key) 
			{
				this.indexed = false;
				this.nav = nav;
				//Named indexes are stored in a hashtable.
				if (indexes == null)
					indexes = new Hashtable();
				XPathNavigatorIndex index = (XPathNavigatorIndex)indexes[indexName];
				if (index == null) 
				{
					index = new XPathNavigatorIndex(); 
					indexes.Add(indexName, index);
				}       
				index.AddKey(key);
			}