@classmethod<EOL><INDENT>def from_xml(cls, element):<DEDENT>
<EOL>items = []<EOL>jids = set()<EOL>if element.tag != QUERY_TAG:<EOL><INDENT>raise ValueError("<STR_LIT>".format(element))<EOL><DEDENT>version = element.get("<STR_LIT>")<EOL>for child in element:<EOL><INDENT>if child.tag != ITEM_TAG:<EOL><INDENT>logger.debug("<STR_LIT>".format(child))<EOL>continue<EOL><DEDENT>item = RosterItem.from_xml(child)<EOL>if item.jid in jids:<EOL><INDENT>logger.warning("<STR_LIT>".format(<EOL>item.jid))<EOL>continue<EOL><DEDENT>jids.add(item.jid)<EOL>items.append(item)<EOL><DEDENT>return cls(items, version)<EOL>
Create a `RosterPayload` object from an XML element.

:Parameters:
    - `element`: the XML element
:Types:
    - `element`: :etree:`ElementTree.Element`

:return: a freshly created roster payload
:returntype: `cls`