def __init__(self, name=None, to=None, typ=None, frm=None, attrs={}, payload=[], timestamp=None, xmlns=None, node=None):
        """ Constructor, name is the name of the stanza i.e. 'message' or 'presence' or 'iq'.
            to is the value of 'to' attribure, 'typ' - 'type' attribute
            frn - from attribure, attrs - other attributes mapping, payload - same meaning as for simplexml payload definition
            timestamp - the time value that needs to be stamped over stanza
            xmlns - namespace of top stanza node
            node - parsed or unparsed stana to be taken as prototype.
        """
        if not attrs: attrs={}
        if to: attrs['to']=to
        if frm: attrs['from']=frm
        if typ: attrs['type']=typ
        Node.__init__(self, tag=name, attrs=attrs, payload=payload, node=node)
        if not node and xmlns: self.setNamespace(xmlns)
        if self['to']: self.setTo(self['to'])
        if self['from']: self.setFrom(self['from'])
        if node and type(self)==type(node) and self.__class__==node.__class__ and self.attrs.has_key('id'): del self.attrs['id']
        self.timestamp=None
        for x in self.getTags('x',namespace=NS_DELAY):
            try:
                if not self.getTimestamp() or x.getAttr('stamp')<self.getTimestamp(): self.setTimestamp(x.getAttr('stamp'))
            except: pass
        if timestamp is not None: self.setTimestamp(timestamp)  # To auto-timestamp stanza just pass timestamp=''
 Constructor, name is the name of the stanza i.e. 'message' or 'presence' or 'iq'.
            to is the value of 'to' attribure, 'typ' - 'type' attribute
            frn - from attribure, attrs - other attributes mapping, payload - same meaning as for simplexml payload definition
            timestamp - the time value that needs to be stamped over stanza
            xmlns - namespace of top stanza node
            node - parsed or unparsed stana to be taken as prototype.
        
chrome-cordova/gcmServer/xmpp/protocol.py