Element element = entry.getKey();
QName elementQName = getQNameOfSchemaElement(element);
QName type = entry.getValue();
if (complexTypeMap.containsKey(type)) {
DocumentFactory factory = (DocumentFactory) complexTypeMap.get(type);
elementQName.setDocumentFactory(factory);
} else if (simpleTypeMap.containsKey(type)) {
XSDatatype datatype = (XSDatatype) simpleTypeMap.get(type);
DocumentFactory factory = (DocumentFactory) elementFactoryMap.get(element);
if (factory instanceof DatatypeElementFactory) {
((DatatypeElementFactory) factory).setChildElementXSDatatype(elementQName, datatype);
}
}