parameters: (self)
return_statement: return xml.to_string(element)
docstring: provide the ability for a widget to serialize itself
docstring_summary: provide the ability for a widget to serialize itself
docstring_tokens: provide the ability for a widget to serialize itself
function: def serialize(self):
          '''provide the ability for a widget to serialize itself'''
  
          xml = Xml()
          xml.create_doc("config")
  
          # create the top element
          element = xml.create_element("element")
          xml.set_attribute(element, "name", self.name)
  
          # create the display handler
          display = xml.create_element("display")
          xml.set_attribute(display, "class", Common.get_full_class_name(self) )
          element.appendChild(display)
  
          # create the options
          for name, value in self.kwargs.items():
              if value:
                  option = xml.create_text_element(name, value)
              else:  # avoid the \n in the textContent of the textNode 
                  option = xml.create_element(name) 
              display.appendChild(option)
  
          return xml.to_string(element)
function_tokens: def serialize ( self ) : xml = Xml ( ) xml . create_doc ( "config" ) # create the top element element = xml . create_element ( "element" ) xml . set_attribute ( element , "name" , self . name ) # create the display handler display = xml . create_element ( "display" ) xml . set_attribute ( display , "class" , Common . get_full_class_name ( self ) ) element . appendChild ( display ) # create the options for name , value in self . kwargs . items ( ) : if value : option = xml . create_text_element ( name , value ) else : # avoid the \n in the textContent of the textNode  option = xml . create_element ( name ) display . appendChild ( option ) return xml . to_string ( element )