#NEWLINE# def emit( self , fo , encoding = DEFAULT_ENCODING ) : #NEWLINE# #INDENT# if ( encoding != self . encoding ) : #NEWLINE# #INDENT# self . set_encoding ( encoding ) #NEWLINE# #UNINDENT# fo . write ( self . XMLHEADER ) #NEWLINE# fo . write ( self . DOCTYPE ) #NEWLINE# self . root . emit ( fo , encoding ) #NEWLINE# fo . write ( b'\n' )