def METHOD_NAME(self, alignment):
    """Return a string with a single alignment in the Phylip format."""
    names = []
    for record in alignment.sequences:
        try:
            name = record.id
        except AttributeError:
            name = ""
        else:
            name = name.strip()
            for char in "[](),":
                name = name.replace(char, "")
            for char in ":;":
                name = name.replace(char, "|")
            name = name[:_PHYLIP_ID_WIDTH]
        names.append(name)
    lines = []
    nseqs, length = alignment.shape
    if nseqs == 0:
        raise ValueError("Must have at least one sequence")
    if length == 0:
        raise ValueError("Non-empty sequences are required")
    line = "%d %d\n" % (nseqs, length)
    lines.append(line)
    # From experimentation, the use of tabs is not understood by the
    # EMBOSS suite.  The nature of the expected white space is not
    # defined in the PHYLIP documentation, simply "These are in free
    # format, separated by blanks".  We'll use spaces to keep EMBOSS
    # happy.
    for name, sequence in zip(names, alignment):
        # Write the entire sequence to one line
        line = name[:_PHYLIP_ID_WIDTH].ljust(_PHYLIP_ID_WIDTH) + sequence + "\n"
        lines.append(line)
    return "".join(lines)