<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def map_to_data_element(self, resource):
 """ Maps the given resource to a data element tree. """

        trv = ResourceTreeTraverser(resource, self.as_pruning())
        visitor = DataElementBuilderResourceTreeVisitor(self)
        trv.run(visitor)
        return visitor.data_element