public function insertXML($xml, $mode = 'append')
    {
        $tmp = dom_import_simplexml($this);
        $fragment = $tmp->ownerDocument->createDocumentFragment();

        /**
         * Disable error reporting
         */
        $use_errors = libxml_use_internal_errors(true);

        if (!$fragment->appendXML($xml)) {
            libxml_use_internal_errors($use_errors);
            throw new InvalidArgumentException(libxml_get_last_error()->message);
        }
        libxml_use_internal_errors($use_errors);

        $this->insertNode($tmp, $fragment, $mode);

        return $this;
    }