code: private static Collection<String> getNames(final OptionElement subroot,
                                               final String[] pathElements, int pos) {
      if (pos >= 0) {
        // Not at root.
        if (!pathElements[pos].equals(subroot.name)) {
          return null;
        }
      }
  
      if (subroot.isValue) {
        return null;
      }
  
      pos++;
      ArrayList<String> res = new ArrayList<String>();
  
      if (pos == pathElements.length) {
        /* return names children of this level */
  
        for (OptionElement optel: subroot.getChildren()) {
          if (optel.isValue) {
            res.add(optel.name);
          }
        }
  
        return res;
      }
  
      for (OptionElement optel: subroot.getChildren()) {
        Collection<String> subres = getNames(optel, pathElements, pos);
        if (subres != null) {
          res.addAll(subres);
        }
      }
  
      return res;
    }
docs: Given a path e.g. org.bedework.global.module return names of children
  
  @param subroot
  @param pathElements
  @param pos
  @return Collection<String>