code: public CmsEntity createDeepCopy(String entityId) {
  
          CmsEntity result = new CmsEntity(entityId, getTypeName());
          for (CmsEntityAttribute attribute : getAttributes()) {
              if (attribute.isSimpleValue()) {
                  List<String> values = attribute.getSimpleValues();
                  for (String value : values) {
                      result.addAttributeValue(attribute.getAttributeName(), value);
                  }
              } else {
                  List<CmsEntity> values = attribute.getComplexValues();
                  for (CmsEntity value : values) {
                      result.addAttributeValue(attribute.getAttributeName(), value.createDeepCopy(null));
                  }
              }
          }
          return result;
      }
docs: Creates a deep copy of this entity.<p>
  
  @param entityId the id of the new entity, if <code>null</code> a generic id will be used
  
  @return the entity copy