Object obj = i.next();
Name name = objectFactory.createName();
if (obj instanceof String) {
name.setValue((String)obj);
} else if (obj instanceof LocalizedString) {
LocalizedString ls = (LocalizedString)obj;
name.setValue(ls.getValue());
name.setLang(ls.getLocale().getLanguage());
}
result[currLoc] = name;
currLoc++;
}
return result;