code: private void unlinkAllChildReferences() {
      List<ModelElementType> childElementTypes = elementType.getAllChildElementTypes();
      for (ModelElementType type : childElementTypes) {
        Collection<ModelElementInstance> childElementsForType = getChildElementsByType(type);
        for (ModelElementInstance childElement : childElementsForType) {
          ((ModelElementInstanceImpl) childElement).unlinkAllReferences();
        }
      }
    }
docs: Removes every reference to children of this.