static Hashtable CreateHash (XMLNamespace [] other)
		{
			Hashtable result = new Hashtable ();
			if (other != null) {
				int i = 0;
				foreach (XMLNamespace n in other) {
					result [n.Name] = i++;
				}
			}

			return result;
		}
		void CompareNamespaces (XmlNode parent, XMLNamespace [] other)
		{
			ArrayList newNS = new ArrayList ();
			XmlNode group = document.CreateElement ("namespaces", null);
			parent.AppendChild (group);

			Hashtable oh = CreateHash (other);
			XmlNode node = null;
			int count = (namespaces == null) ? 0 : namespaces.Length;
			for (int i = 0; i < count; i++) {
				XMLNamespace xns = namespaces [i];

				node = document.CreateElement ("namespace", null);
				newNS.Add (node);
				AddAttribute (node, "name", xns.Name);

				int idx = -1;
				if (oh.ContainsKey (xns.Name))
					idx = (int) oh [xns.Name];
				XMLNamespace ons = idx >= 0 ? (XMLNamespace) other [idx] : null;
				xns.CompareTo (document, node, ons);
				if (idx >= 0)
					other [idx] = null;
				xns.AddCountersAttributes (node);
				counters.Present++;
				counters.PresentTotal++;
				counters.AddPartialToTotal (xns.Counters);
			}

			if (other != null) {
				count = other.Length;
				for (int i = 0; i < count; i++) {
					XMLNamespace n = other [i];
					if (n == null)
						continue;

					node = document.CreateElement ("namespace", null);
					newNS.Add (node);
					AddAttribute (node, "name", n.Name);
					AddExtra (node);
					counters.ExtraTotal++;
				}
			}

			XmlNode [] nodes = (XmlNode []) newNS.ToArray (typeof (XmlNode));
			Array.Sort (nodes, XmlNodeComparer.Default);
			foreach (XmlNode nn in nodes)
				group.AppendChild (nn);
		}