code: static Optional<XmlElement> getErrorElement(XmlElement rootXmlElement) {
      Optional<XmlElement> elem = rootXmlElement.getChildOpt("error");
      if (elem.isPresent()) {
        ApiException error = elem.transform(toApiException()).get();
        log.error(error.getCode() + ": " + error.getValue());
      }
      return elem;
    }
docs: Determines if the given XML Document contains an error message which then would printed by the
  logger.
  
  @param rootXmlElement XML <code>Document</code>
  @return error element