code: public function parse(SaxHandlerInterface $saxHandler, $xmlDocument)
      {
          $xmlDocument = ($xmlDocument instanceof StreamInterface) ? $xmlDocument : $this->getDocumentStream($xmlDocument);
          return $saxHandler->parse($xmlDocument);
      }
docs: Parse XML document using provided SAX handler.
  
  @param SaxHandlerInterface $saxHandler Handler to user for parsing document.
  @param mixed $xmlDocument XML document source.
  
  @return mixed Parsing result.