private function guessFromContent($filename)
    {
        $output = 'text';
        if (!is_file($filename)) {
            return $output;
        }
        if ($fileContents = file_get_contents($filename)) {
            if (1 === preg_match('/<?xml.*?>/', $fileContents)) {
                $output = 'xml';
            }
        }

        return $output;
    }