code: @SuppressWarnings("unchecked")
    private static Collection match(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) {
        // pos must be last entry
        if ((pos + 1) != pathElements.length) {
          return null;
        }
        ArrayList res = new ArrayList();
  
        res.add(subroot.val);
        return res;
      }
  
      ArrayList res = new ArrayList();
  
      pos++;
      if (pos == pathElements.length) {
        /* return all the children of this level */
  
        for (OptionElement optel: subroot.getChildren()) {
          if (optel.isValue) {
            res.add(optel.val);
          }
        }
  
        return res;
      }
  
      for (OptionElement optel: subroot.getChildren()) {
        Collection subres = match(optel, pathElements, pos);
        if (subres != null) {
          res.addAll(subres);
        }
      }
  
      return res;
    }
docs: Given a path e.g. org.bedework.global.module return all children which
  are leaf nodes, i.e values.
  
  @param subroot
  @param pathElements
  @param pos
  @return Collection