alist.add(parseType(targetClazz, ((OMElement)children.next()).getText()));
return alist.toArray((Object[]) Array.newInstance(targetClazz, alist.size()));
} else if (XmlObject.class.isAssignableFrom(clazz)) {
try {
Class beanFactory = clazz.forName(clazz.getCanonicalName() + "$Factory");
elmt.setNamespace(new NamespaceImpl(""));
elmt.setLocalName("xml-fragment");
return beanFactory.getMethod("parse", XMLStreamReader.class)
.invoke(null, elmt.getXMLStreamReaderWithoutCaching());
} catch (ClassNotFoundException e) {
throw new RuntimeException("Couldn't find class " + clazz.getCanonicalName() + ".Factory to instantiate xml bean", e);