def get_path_traversal_output(events_df):
    """ Parses the experiencedPlans.xml file to create the trips dataframe, gathering each person's trips' attributes
    (person id, trip id, id of the origin activity of the trip, id of the destination activity of the trip, trip purpose,
    mode used, start time of the trip, duration of the trip, distance of the trip, path of the trip)

    Parameters
    ----------
    events_df: pandas DataFrame
        DataFrame extracted from the outputEvents.xml` file: output of the extract_dataframe() function

    trips_df: pandas DataFrame
        Record of each person's trips' attributes: output of the  get_trips_output() function

    Returns
    -------
    path_traversal_events_df: pandas DataFrame

    """
    # creates a dataframe of trip legs using the events dataframe; creates and saves a pathTraversal dataframe to csv
    # outputs the legs dataframe


    # Selecting the columns of interest
    events_df = events_df[['time', 'type', 'person', 'vehicle', 'driver', 'vehicleType', 'length',
         'numPassengers', 'departureTime', 'arrivalTime', 'mode', 'links',
         'fuelType', 'fuel']]

    # get all path traversal events (all vehicle movements, and all person walk movements)
    path_traversal_events_df = events_df[(events_df['type'] == 'PathTraversal') & (events_df['length'] > 0)]
    path_traversal_events_df = path_traversal_events_df.reset_index(drop=True)
    path_traversal_events_df = path_traversal_events_df

    return path_traversal_events_df