def to_xml(self):
        """Convert to XML message."""
        element = etree.Element(self._tag_name)
        struct_to_xml(element, [
            {"author": self.handle},
            {"recipient": self.target_handle},
            {"following": "true" if self.following else "false"},
            {"sharing": "true" if self.following else "false"},
        ])
        return element
def to_xml ( self ) : element = etree . Element ( self . _tag_name ) struct_to_xml ( element , [ { "author" : self . handle } , { "recipient" : self . target_handle } , { "following" : "true" if self . following else "false" } , { "sharing" : "true" if self . following else "false" } , ] ) return element
Convert to XML message.