def setRequired(self,req=1):
        """ Change the state of the 'required' flag. """
        if req: self.setTag('required')
        else:
            try: self.delChild('required')
            except ValueError: return
 Change the state of the 'required' flag. 
chrome-cordova/gcmServer/xmpp/protocol.py