UN members have voted overwhelmingly to end Israel's decades-long occupation of Palestinian territory in what is a non-binding resolution.