'Parse out info from the \'<?xml version=...\' prolog, if any.
Returns (<has-xml-prolog>, <xml-version>, <xml-encoding>). Examples:
(False, None, None)
(True, "1.0", None)
(True, "1.0", "UTF-16")'

def _get_xml_prolog_info(self, head_bytes):

    if (not head_bytes.startswith('<?xml')):
        return (False, None, None)
    match = self._xml_prolog_pat.match(head_bytes)
    if (not match):
        if log.isEnabledFor(logging.DEBUG):
            log.debug("`%s':    could    not    match    XML    prolog:    '%s'", self.path, _one_line_summary_from_text(head_bytes, 40))
        return (False, None, None)
    xml_version = match.group('ver')
    xml_encoding = match.group('enc')
    return (True, xml_version, xml_encoding)
