* @throws ClassNotFoundException when subclasses cannot be loaded
*/
public static String elementName(DomDocument document, Class<?> parent, Class<?> child)
throws ClassNotFoundException {
ConfigModel cm = document.buildModel(parent);
for (String elementName : cm.getElementNames()) {
ConfigModel.Property prop = cm.getElement(elementName);
if (prop instanceof ConfigModel.Node) {
ConfigModel childCM = ((ConfigModel.Node) prop).getModel();
String childTypeName = childCM.targetTypeName;
if (childTypeName.equals(child.getName())) {
return childCM.getTagName();
}
// check the inheritance hierarchy
List<ConfigModel> subChildrenModels = document.getAllModelsImplementing(
childCM.classLoaderHolder.loadClass(childTypeName));
if (subChildrenModels!=null) {