code: public static Optional<Element> getChildElement(final Element elem, final String ns, final String name) {
          final NodeList children = elem.getChildNodes();
          for (int i = 0; i < children.getLength(); i++) {
              final Node child = children.item(i);
              if (child.getNodeType() == Node.ELEMENT_NODE) {
                  if (Objects.equals(child.getNamespaceURI(), ns) && name.equals(child.getLocalName())) {
                      return Optional.of((Element) child);
                  }
              }
          }
          return Optional.empty();
      }
docs: Get first child element by element name.
  
  @param elem root element
  @param ns namespace URI, {@code null} for empty namespace
  @param name element name to match element
  @return matching element