#NEWLINE# def _serialize( domtree ) : #NEWLINE# #INDENT# walker = html5lib . treewalkers . getTreeWalker ( 'etree' ) #NEWLINE# stream = walker ( domtree ) #NEWLINE# serializer = HTMLSerializer ( quote_attr_values = True , alphabetical_attributes = True , omit_optional_tags = False ) #NEWLINE# return serializer . render ( stream )