'Convert the rdataset into DNS master file format.
@see: L{dns.name.Name.choose_relativity} for more information
on how I{origin} and I{relativize} determine the way names
are emitted.
Any additional keyword arguments are passed on to the rdata
to_text() method.
@param name: If name is not None, emit a RRs with I{name} as
the owner name.
@type name: dns.name.Name object
@param origin: The origin for relative names, or None.
@type origin: dns.name.Name object
@param relativize: True if names should names be relativized
@type relativize: bool'

def to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw):

    if (not (name is None)):
        name = name.choose_relativity(origin, relativize)
        ntext = str(name)
        pad = '    '
    else:
        ntext = ''
        pad = ''
    s = StringIO.StringIO()
    if (not (override_rdclass is None)):
        rdclass = override_rdclass
    else:
        rdclass = self.rdclass
    if (len(self) == 0):
        print >>s, ('%s%s%s    %s' % (ntext, pad, dns.rdataclass.to_text(rdclass), dns.rdatatype.to_text(self.rdtype)))
    else:
        for rd in self:
            print >>s, ('%s%s%d    %s    %s    %s' % (ntext, pad, self.ttl, dns.rdataclass.to_text(rdclass), dns.rdatatype.to_text(self.rdtype), rd.to_text(origin=origin, relativize=relativize, **kw)))
    return s.getvalue()[:(-1)]
