<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def digest(self, **args):

 """calculate a digest based on the hash of the XML content"""

        return String(XML.canonicalized_string(self.root)).digest(**args)