<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addAllowMAC(self, xEUI):
 """add a given extended address to the whitelist addressfilter Args: xEUI: a given extended address in hex format Returns: True: successful to add a given extended address to the whitelist entry False: fail to add a given extended address to the whitelist entry """

        print '%s call addAllowMAC' % self.port
        print xEUI
        if isinstance(xEUI, str):
            macAddr = xEUI
        else:
            macAddr = self.__convertLongToString(xEUI)

        try:
            if self._addressfilterMode != 'whitelist':
                if self.__setAddressfilterMode('Whitelist'):
                    self._addressfilterMode = 'whitelist'

            cmd = WPANCTL_CMD + 'insert MAC:Whitelist:Entries %s' % macAddr
            ret = self.__sendCommand(cmd)[0] != 'Fail'

            self._addressfilterSet.add(macAddr)
            print 'current whitelist entries:'
            for addr in self._addressfilterSet:
                print addr
            return ret

        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger('addAllowMAC() Error: ' + str(e))