code: def to_xml(self, tag_name="buyer"):
          '''
          Returns an XMLi representation of the object.
          @param tag_name:str Tag name
          @return: Element
          '''
          for n, v in {"name": self.name, "address": self.address}.items():
              if is_empty_or_none(v):
                  raise ValueError("'%s' attribute cannot be empty or None." % n)
  
          if self.__require_id and is_empty_or_none(self.identifier):
              raise ValueError("identifier attribute cannot be empty or None.")
  
          doc = Document()
          root = doc.createElement(tag_name)
          self._create_text_node(root, "id", self.identifier)
          self._create_text_node(root, "name", self.name, True)
          if self.phone:
              self._create_text_node(root, "phone", self.phone, True)
          root.appendChild(self.address.to_xml())
          return roof to_xml(self, tag_name="buyer"):
          '''
          Returns an XMLi representation of the object.
          @param tag_name:str Tag name
          @return: Element
          '''
          for n, v in {"name": self.name, "address": self.address}.items():
              if is_empty_or_none(v):
                  raise ValueError("'%s' attribute cannot be empty or None." % n)
  
          if self.__require_id and is_empty_or_none(self.identifier):
              raise ValueError("identifier attribute cannot be empty or None.")
  
          doc = Document()
          root = doc.createElement(tag_name)
          self._create_text_node(root, "id", self.identifier)
          self._create_text_node(root, "name", self.name, True)
          if self.phone:
              self._create_text_node(root, "phone", self.phone, True)
          root.appendChild(self.address.to_xml())
          return root
docs: Returns an XMLi representation of the object.
          @param tag_name:str Tag name
          @return: Element