<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def togpx(self):
 """Generate a GPX waypoint element subtree. Returns: etree.Element: GPX element """

        element = create_elem(self.__class__._elem_name,
                              {'lat': str(self.latitude),
                               'lon': str(self.longitude)})
        if self.name:
            element.append(create_elem('name', text=self.name))
        if self.description:
            element.append(create_elem('desc', text=self.description))
        if self.elevation:
            element.append(create_elem('ele', text=str(self.elevation)))
        if self.time:
            element.append(create_elem('time', text=self.time.isoformat()))
        return element