code: public static List<Element> getChildElements(final Element elem, final DitaClass cls, final boolean deep) {
          final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
          final List<Element> res = new ArrayList<>(children.getLength());
          for (int i = 0; i < children.getLength(); i++) {
              final Node child = children.item(i);
              if (cls.matches(child)) {
                  res.add((Element) child);
              }
          }
          return res;
      }
docs: List descendant elements by DITA class.
  
  @param elem root element
  @param cls DITA class to match elements
  @param deep {@code true} to read descendants, {@code false} to read only direct children
  @return list of matching elements