#NEWLINE# def add_to_document( self , parent ) : #NEWLINE# #INDENT# 'Adds an ``Argument`` object to this ElementTree document.\n\n        Adds an <arg> subelement to the parent element, typically <args>\n        and sets up its subelements with their respective text.\n\n        :param parent: An ``ET.Element`` to be the parent of a new <arg> subelement\n        :returns: An ``ET.Element`` object representing this argument.\n        ' #NEWLINE# arg = ET . SubElement ( parent , 'arg' ) #NEWLINE# arg . set ( 'name' , parent . name ) #NEWLINE# if ( self . description is not None ) : #NEWLINE# #INDENT# ET . SubElement ( arg , 'description' ) . text = self . description #NEWLINE# #UNINDENT# if ( self . validation is not None ) : #NEWLINE# #INDENT# ET . SubElement ( arg , 'validation' ) . text = self . validation #NEWLINE# #UNINDENT# subelements = [ ( 'data_type' , self . data_type ) , ( 'required_on_edit' , self . required_on_edit ) , ( 'required_on_create' , self . required_on_create ) ] #NEWLINE# for ( name , value ) in subelements : #NEWLINE# #INDENT# ET . SubElement ( arg , name ) . text = str ( value ) . lower ( ) #NEWLINE# #UNINDENT# return arg