docs: public void removeChild(ElementBase child, boolean destroy) {
          if (!children.contains(child)) {
              return;
          }
          
          boolean isLocked = child.isLocked() || child.getDefinition().isInternal();
          
          if (destroy) {
              child.removeChildren();
              
              if (!isLocked) {
                  child.destroy();
              }
          }
          
          if (!isLocked) {
              beforeRemoveChild(child);
              children.remove(child);
              child.updateParent(null);
              afterRemoveChild(child);
          }
      }