code: def to_xdr_object(self):
          
  
          def assert_option_array(x):
              if x is None:
                  return []
              if not isinstance(x, list):
                  return [x]
              return x
  
          if self.inflation_dest is not None:
              inflation_dest = [account_xdr_object(self.inflation_dest)]
          else:
              inflation_dest = []
  
          self.clear_flags = assert_option_array(self.clear_flags)
          self.set_flags = assert_option_array(self.set_flags)
          self.master_weight = assert_option_array(self.master_weight)
          self.low_threshold = assert_option_array(self.low_threshold)
          self.med_threshold = assert_option_array(self.med_threshold)
          self.high_threshold = assert_option_array(self.high_threshold)
          self.home_domain = assert_option_array(self.home_domain)
  
          req_signer_fields = (self.signer_address, self.signer_type,
                               self.signer_weight)
  
          if all(signer_field is not None for signer_field in req_signer_fields):
              signer = [
                  Xdr.types.Signer(
                      signer_key_xdr_object(self.signer_type,
                                            self.signer_address),
                      self.signer_weight)
              ]
          else:
              signer = []
  
          set_options_op = Xdr.types.SetOptionsOp(
              inflation_dest, self.clear_flags, self.set_flags,
              self.master_weight, self.low_threshold, self.med_threshold,
              self.high_threshold, self.home_domain, signer)
          self.body.type = Xdr.const.SET_OPTIONS
          self.body.setOptionsOp = set_options_op
          return super(SetOptions, self).to_xdr_object()
docs: Creates an XDR Operation object that represents this
          :class:`SetOptions`.