code: def detect_parser_type(cls, file, encoding=None):
          '''Get the suitable parser type for the document.
  
          Returns:
              str
          '''
          is_xml = XMLDetector.is_file(file)
          doctype = cls.parse_doctype(file, encoding=encoding) or ''
  
          if not doctype and is_xml:
              return 'xml'
  
          if 'XHTML' in doctype:
              return 'xhtml'
  
          return 'htmlf detect_parser_type(cls, file, encoding=None):
          '''Get the suitable parser type for the document.
  
          Returns:
              str
          '''
          is_xml = XMLDetector.is_file(file)
          doctype = cls.parse_doctype(file, encoding=encoding) or ''
  
          if not doctype and is_xml:
              return 'xml'
  
          if 'XHTML' in doctype:
              return 'xhtml'
  
          return 'html'
docs: Get the suitable parser type for the document.
  
          Returns:
              str