'Format the given string using the given formatter.'

@classmethod
def format_string(self, s, formatter='minimal'):

    if (not callable(formatter)):
        formatter = self.FORMATTERS.get(formatter, EntitySubstitution.substitute_xml)
    if (formatter is None):
        output = s
    else:
        output = formatter(s)
    return output
