code: def tuple_to_schema(tuple_):
      
      schema = []
      for element in tuple_:
          if isinstance(element, (tuple, list)):
              try:
                  if isinstance(element[1], six.string_types):
                      schema.append((element[0],))
                  else:
                      schema.append(tuple_to_schema(element))
              except IndexError:
                  schema.append((element[0],))
          else:
              schema.append(element)
      return tuple(schema)
docs: Convert a tuple representing an XML data structure into a schema tuple
      that can be used in the ``.schema`` property of a sub-class of
      PREMISElement.