def as_xml(self, parent = None):
if parent is not None:<EOL><INDENT>element = ElementTree.SubElement(parent, ITEM_TAG)<EOL><DEDENT>else:<EOL><INDENT>element = ElementTree.Element(ITEM_TAG)<EOL><DEDENT>element.set("<STR_LIT>", str(self.jid))<EOL>if self.name is not None:<EOL><INDENT>element.set("<STR_LIT:name>", self.name)<EOL><DEDENT>if self.subscription is not None:<EOL><INDENT>element.set("<STR_LIT>", self.subscription)<EOL><DEDENT>if self.ask:<EOL><INDENT>element.set("<STR_LIT>", self.ask)<EOL><DEDENT>if self.approved:<EOL><INDENT>element.set("<STR_LIT>", "<STR_LIT:true>")<EOL><DEDENT>for group in self.groups:<EOL><INDENT>ElementTree.SubElement(element, GROUP_TAG).text = group<EOL><DEDENT>return element<EOL>
Make an XML element from self.

        :Parameters:
            - `parent`: Parent element
        :Types:
            - `parent`: :etree:`ElementTree.Element`