// Convert the contents of the specified security element // to hash codes stored in a hash table. private static void ConvertToHashTable(SecurityElement xmlElement) { // Create a hash table to hold hash codes of the security elements. //<Snippet16> Hashtable xmlAsHash = new Hashtable(); int rootIndex = xmlElement.GetHashCode(); xmlAsHash.Add(rootIndex, "root"); //</Snippet16> int parentNum = 0; foreach (SecurityElement xmlParent in xmlElement.Children) { parentNum++; xmlAsHash.Add(xmlParent.GetHashCode(), "parent" + parentNum); if ((xmlParent.Children != null) && (xmlParent.Children.Count > 0)) { int childNum = 0; foreach (SecurityElement xmlChild in xmlParent.Children) { childNum++; xmlAsHash.Add(xmlChild.GetHashCode(), "child" + childNum); } } } }