Allows finding the most specific path that exists. This is useful for error messages relating to attribute paths.