try {
if (contentType.equalsIgnoreCase(TEXT_XML)
|| contentType.equalsIgnoreCase(APPLICATION_XML)) {
return registerNodeTypes(new InputSource(in));
} else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND)) {
NamespaceMapping mapping = new NamespaceMapping(nsResolver);
CompactNodeTypeDefReader reader = new CompactNodeTypeDefReader(
new InputStreamReader(in), "cnd input stream", mapping);
Map nsMap = mapping.getPrefixToURIMapping();
Iterator iterator = nsMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
nsReg.safeRegisterNamespace(
(String) entry.getKey(), (String) entry.getValue());