code: public void deleteSubtreeExcludingRoot(Dn root) throws NoSuchNodeException, MissingParentException {
          existsCheck(root);
          try {
              EntryCursor entryCursor = connection.search(root, "(objectclass=*)", SearchScope.ONELEVEL);
              while (entryCursor.next()) {
                  deleteSubtreeIncludingRoot(entryCursor.get().getDn());
              }
          } catch (Exception e) {
              throw new LdapDaoException(e);
          }
      }
docs: Deletes the entire subtree of root but not root itself. Throws NoSuchNodeException if root does not exist. Throws
  MissingParentException if some node above root does not exist.