<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_sub_node(self, node):
 """Extract node from document if desired."""


        subnode = node.find('office:document')
        if subnode:
            mimetype = subnode.attrs['office:mimetype']
            self.type = MIMEMAP[mimetype]
            node = node.find('office:body')
        return node