def _MakeDispatchListIntoYaml(application, dispatch_list):
  """Converts list of DispatchEntry objects into a YAML string."""
  statements = []
  if application:
    statements.append('application: %s' % application)
  statements.append('dispatch:')
  for entry in dispatch_list:
    statements += entry.ToYaml()
  return '\n'.join(statements) + '\n'