Parse the NS API xml result into Trip objects

def parse_trips(self, xml, requested_time):
        """
        Parse the NS API xml result into Trip objects
        """
        obj = xmltodict.parse(xml)
        trips = []

        if 'error' in obj:
            print('Error in trips: ' + obj['error']['message'])
            return None

        try:
            for trip in obj['ReisMogelijkheden']['ReisMogelijkheid']:
                newtrip = Trip(trip, requested_time)
                trips.append(newtrip)
        except TypeError:
            # If no options are found, obj['ReisMogelijkheden'] is None
            return None

        return trips