@classmethod
def deserialattributes(cls, xstype, elem):
    """
        helper methods to deserialse xml attributes.
        """
    ret = {}
    attributes = xstype.getattributes()
    if attributes:
        for attrib in attributes:
            attrname = attrib.getname()
            attrvalue = None
            if attrname in elem.attrib:
                attrvalue = attrib.decode(elem.attrib[attrname])
                ret[attrname] = attrvalue
    if ret:
        return ret
    return None
