#NEWLINE# def dump( self , stream ) : #NEWLINE# #INDENT# if self . prettyprint : #NEWLINE# #INDENT# self . indent ( self . xml ) #NEWLINE# #UNINDENT# document = ElementTree ( self . xml ) #NEWLINE# header = ( '<?xml version="1.0" encoding="%s"?>' % self . encoding ) #NEWLINE# stream . write ( header . encode ( self . encoding ) ) #NEWLINE# document . write ( stream , encoding = self . encoding )