// if already has an adapter, no need to recreate/initialize.
// Note: this means if "doctype" for DOM changes,
// theDocumentTypeAdatper for that DOM
// should be removed (and released) and it will be re-created next
// time required.
DocumentTypeAdapter oldAdapter = (DocumentTypeAdapter) notifier.getExistingAdapter(DocumentTypeAdapter.class);
if (oldAdapter != null) {
result = oldAdapter;
}
else {