private function validate(SimpleXMLElement $xml): void
    {
        if ($xml->getName() !== 'phpdocumentor') {
            throw new InvalidArgumentException(
                sprintf('Root element name should be phpdocumentor, %s found', $xml->getName())
            );
        }
    }