protected static NamespaceCacheElement[] enumerateAncestors(NamespaceCacheElement ncElem, bool includeSelf) { Generic.List <NamespaceCacheElement> ncAncestors = new Generic.List <NamespaceCacheElement>(); if (includeSelf) { ncAncestors.Insert(0, ncElem); } while (ncElem.Parent != null) { ncElem = ncElem.Parent; ncAncestors.Insert(0, ncElem); } return(ncAncestors.ToArray()); }