def format_result(result, info):
    """
    Formats the given resultset.

    @param result: the result to format.
    @param info:   return only the header information.
    """

    if info:

        return '\n'.join([
            'Domain: ' + str(result.domain),
            'Request ID: ' + str(result.request_id),
            'State: ' + str(result.state),
            'Comment: ' + str(result.comment),
            'Created: ' + str(result.created)])

    else:
        return str(result)