    def traverse(cls, base, request, path_items):
        """See ``zope.app.pagetemplate.engine``."""

        path_items = list(path_items)
        path_items.reverse()

        while path_items:
            name = path_items.pop()
            if ITraversable.providedBy(base):
                base = getattr(base, cls.traverseMethod)(name)
            else:
                base = traversePathElement(base, name, path_items,
                                           request=request)

        return base