code: 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:
              #
              # Empty rdatasets are used for the question section, and in
              # some dynamic updates, so we don't need to print out the TTL
              # (which is meaningless anyway).
              #
              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))
          #
          # We strip off the final \n for the caller's convenience in printing
          #
          return s.getvalue()[:-1]
docs: 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