String subTypeName = type.getAttributeTypeName(attributeName);
if (registeredTypes.get(subTypeName).isSimpleType()) {
String path = removeFirstTwoPathLevel(child.getPath());
I_CmsXmlContentValue value = content.getValue(path, locale);
result.addAttributeValue(attributeName, value.getStringValue(cms));
<BUG>} else {
Entity subEntity = readEntity(
content,
child,
locale,
entityId + "/" + attributeName + counter,
subTypeName,
registeredTypes);</BUG>
result.addAttributeValue(attributeName, subEntity);

String subTypeName = type.getAttributeTypeName(attributeName);
if (registeredTypes.get(subTypeName).isSimpleType()) {
String path = removeFirstTwoPathLevel(child.getPath());
I_CmsXmlContentValue value = content.getValue(path, locale);
result.addAttributeValue(attributeName, value.getStringValue(cms));
} else {
Entity subEntity = readEntity(content, child, locale, entityId
+ "/"
+ attributeName
+ "["
+ counter
+ "]", subTypeName, registeredTypes);
result.addAttributeValue(attributeName, subEntity);
