Object instance = null;
if (element.getChildNodes().getLength() == 1) {
instance = BeanPropertyComponentAdapter.convert(className, element.getFirstChild().getNodeValue(), classLoader);
} else {
BeanPropertyComponentAdapter propertyComponentAdapter =
new BeanPropertyComponentAdapter(createComponentAdapter(className, classLoader));
Properties properties = createProperties(element.getChildNodes());
propertyComponentAdapter.setProperties(properties);
instance = propertyComponentAdapter.getComponentInstance(pico);
}
return instance;
}