*/
private void cloneTypeList(int depth, boolean includePropertyDefinitions, List<TypeDefinitionContainer> types) {
ListIterator<TypeDefinitionContainer> it = types.listIterator();
while (it.hasNext()) {
TypeDefinitionContainer tdc = it.next();
AbstractTypeDefinition td = ((AbstractTypeDefinition) tdc.getTypeDefinition()).clone();
if (!includePropertyDefinitions)
td.setPropertyDefinitions(null);
TypeDefinitionContainerImpl tdcClone = new TypeDefinitionContainerImpl(td);
if (depth > 0) {
ArrayList<TypeDefinitionContainer> children = new ArrayList<TypeDefinitionContainer>(tdc.getChildren()
.size());
children.addAll(tdc.getChildren());
tdcClone.setChildren(children);
cloneTypeList(depth - 1, includePropertyDefinitions, children);
}
it.set(tdcClone);
}