#NEWLINE# def translate( self ) : #NEWLINE# #INDENT# settings = self . document . settings #NEWLINE# indent = newline = '' #NEWLINE# if settings . newlines : #NEWLINE# #INDENT# newline = '\n' #NEWLINE# #UNINDENT# if settings . indents : #NEWLINE# #INDENT# newline = '\n' #NEWLINE# indent = '    ' #NEWLINE# #UNINDENT# output_prefix = [ ] #NEWLINE# if settings . xml_declaration : #NEWLINE# #INDENT# output_prefix . append ( ( self . xml_declaration % settings . output_encoding ) ) #NEWLINE# #UNINDENT# if settings . doctype_declaration : #NEWLINE# #INDENT# output_prefix . append ( self . doctype ) #NEWLINE# #UNINDENT# output_prefix . append ( ( self . generator % docutils . __version__ ) ) #NEWLINE# docnode = self . document . asdom ( ) . childNodes [ 0 ] #NEWLINE# self . output = ( '' . join ( output_prefix ) + docnode . toprettyxml ( indent , newline ) )