def SplitXmlHeaderFromData(xml_input):
  """Split the XML header from the rest of the document
  Args:
    xml_input: xml with or without xml header
  Returns:
    (xml_header, xml_data): if a header was found
    (None, xml_input): if no header
  """
  if xml_input[:5] == '<?xml':
    end_of_xml_header = xml_input.find('?>')
    return (xml_input[:end_of_xml_header+2],xml_input[end_of_xml_header+2:])
  return (None,xml_input)