ImportElement[] importElements = descriptionElement.getImportElements();
for (int i = 0; i < importElements.length; i++) {
DescriptionElement descElem = importElements[i].getDescriptionElement();
NamespaceDeclaration[] namespaceDeclarations = descElem.getDeclaredNamespaces();
for (int j = 0; j < namespaceDeclarations.length; j++) {
NamespaceDeclaration importedNamespaceDeclaration = namespaceDeclarations[j];
if (!stringBasedNamespaceMap.containsKey(importedNamespaceDeclaration.getPrefix())) {
stringBasedNamespaceMap.put(importedNamespaceDeclaration.getPrefix(),
importedNamespaceDeclaration.getNamespaceURI().toString());
}
}
createNamespaceMap(descElem); // recursively drill down
}