EZP-22612: sort pathElements by prioritized languages before matching