private void addPageNames(Set names, INamespace namespace) { String idPrefix = namespace.getExtendedId(); List pageNames = namespace.getPageNames(); int count = pageNames.size(); for (int i = 0; i < count; i++) { String name = (String) pageNames.get(i); if (idPrefix == null) names.add(name); else names.add(idPrefix + ":" + name); } List ids = namespace.getChildIds(); count = ids.size(); for (int i = 0; i < count; i++) { String id = (String) ids.get(i); addPageNames(names, namespace.getChildNamespace(id)); } }