#NEWLINE# def serialize_tree( self , tree ) : #NEWLINE# #INDENT# file = StringIO ( ) #NEWLINE# tree . write ( file , encoding = 'utf-8' ) #NEWLINE# contents = ( "<?xml version='1.0' encoding='utf-8'?>" + file . getvalue ( ) ) #NEWLINE# file . close ( ) #NEWLINE# return tree