Return xdr code for the body (part between braces) of big 3 types

def xdrbody(self, prefix=''):
        """Return xdr code for the body (part between braces) of big 3 types"""
        body = ''
        prefix += indent
        if self.type == 'enum':
            body = ''.join(
                ["%s,\n" % l.xdrout(prefix) for l in self.body[:-1]])
            body += "%s\n" % self.body[-1].xdrout(prefix)
        elif self.type == 'struct':
            body = ''.join(["%s\n" % l.xdrout(prefix) for l in self.body])
        elif self.type == 'union':
            for l in self.body[1:-1]:
                body += ''.join(["%scase %s:\n" % (prefix, case) \
                                 for case in l.cases])
                body += ''.join([
                    "%s\n" % d.xdrout(prefix + indent) for d in l.declarations
                ])
            if self.body[-1].declarations:
                body += "%sdefault:\n" % prefix + \
                        ''.join(["%s\n" % d.xdrout(prefix + indent)
                                 for d in self.body[-1].declarations])
        return body