code: public static Optional<Element> getChildElement(final Element elem, final DitaClass cls) {
          final NodeList children = elem.getChildNodes();
          for (int i = 0; i < children.getLength(); i++) {
              final Node child = children.item(i);
              if (cls.matches(child)) {
                  return Optional.of((Element) child);
              }
          }
          return Optional.empty();
      }
docs: Get first child element by DITA class.
  
  @param elem root element
  @param cls DITA class to match element
  @return matching element