def add_nonblank_xml_subelement(parent, tag, value):
 if ((value is not None) and (value != '')):
  XML.SubElement(parent, tag).text = value

def add_nonblank_xml_subelement ( parent , tag , value ) : if ( ( value is not None ) and ( value != '' ) ) : XML . SubElement ( parent , tag ) . text = value
adds an xml subelement with the name tag to parent if value is a non-empty string .