CompactNodeTypeDefReader cndReader = new CompactNodeTypeDefReader(reader, TEST_FILE,
new QNodeTypeDefinitionsBuilderImpl());
List ntdList1 = cndReader.getNodeTypeDefs();
NamespaceMapping nsm = cndReader.getNamespaceMapping();
NamePathResolver resolver = new DefaultNamePathResolver(nsm);
// Put imported node type def back into CND form with CND writer
StringWriter sw = new StringWriter();
ValueFactory vf = new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), resolver);
CompactNodeTypeDefWriter.write(ntdList1, nsm, resolver, vf, sw);