FluentDOM\Document::toXml PHP Method

toXml() public method

Overloading saveXML() with a removed type hint triggers an E_STRICT error, so we the function needs a new name. :-(
public toXml ( DOMNode | DOMNodeList | null $context = NULL, integer $options ) : string
$context DOMNode | DOMNodeList | null
$options integer
return string
    public function toXml($context = NULL, $options = 0)
    {
        if ($context instanceof \DOMNodeList) {
            $result = '';
            foreach ($context as $node) {
                $result .= $this->saveXML($node, $options);
            }
            return $result;
        }
        return $this->saveXML($context, $options);
    }