public function toXml(): string
    {
        if (null === $this->document) {
            throw new XslProcessorException(
                    'Can not transform, set document or xml file to transform first'
            );
        }

        $this->registerCallbacks();
        $result = $this->xsltProcessor->transformToXML($this->document);
        if (false === $result) {
            throw new XslProcessorException($this->createMessage());
        }

        return $result;
    }
public function toXml(): string
    {
        if (null === $this->document) {
            throw new XslProcessorException(
                    'Can not transform, set document or xml file to transform first'
            );
        }

        $this->registerCallbacks();
        $result = $this->xsltProcessor->transformToXML($this->document);
        if (false === $result) {
            throw new XslProcessorException($this->createMessage());
        }

        return $result;
    }
public function toXml ( ) : string { if ( null === $ this -> document ) { throw new XslProcessorException ( 'Can not transform, set document or xml file to transform first' ) ; } $ this -> registerCallbacks ( ) ; $ result = $ this -> xsltProcessor -> transformToXML ( $ this -> document ) ; if ( false === $ result ) { throw new XslProcessorException ( $ this -> createMessage ( ) ) ; } return $ result ; }
transforms the document and returns the result as string

@return  string
@throws  \stubbles\xml\xsl\XslProcessorException
transforms the document and returns the result as string