public function loadContent(string $content)
    {
        // run this method with libxml internal errors enabled
        if (true !== libxml_use_internal_errors(true)) {
            try {
                $this->loadContent($content);
            } finally {
                libxml_use_internal_errors(false);
            }
        }

        libxml_clear_errors(); // clear previous libxml errors
        $dom = new DOMDocument();
        @$dom->loadXML($content, LIBXML_NOWARNING | LIBXML_NONET);
        if (false !== $loaderror = libxml_get_last_error()) {
            libxml_clear_errors();  // clear recently libxml errors
            throw new CFDICleanerException('XML Error: ' . $loaderror->message);
        }
        $prefix = $dom->lookupPrefix('http://www.sat.gob.mx/cfd/3');
        if (! $prefix) {
            throw new CFDICleanerException('The XML document is not a CFDI');
        }
        $version = $this->xpathQuery('/' . $prefix . ':Comprobante/@version', $dom->documentElement);
        if ($version->length != 1) {
            $version = $this->xpathQuery('/' . $prefix . ':Comprobante/@Version', $dom->documentElement);
        }
        if ($version->length != 1) {
            throw new CFDICleanerException('The XML document does not contains a version');
        }
        if (! $this->isVersionAllowed($version->item(0)->nodeValue)) {
            throw new CFDICleanerException(
                'The XML document version "' . $version->item(0)->nodeValue . '" is not compatible'
            );
        }
        $this->dom = $dom;
    }