why do we nèed Xin here?
why not: Cảm ơn, tạm biệt ?
'Cảm ơn, tạm biệt' is perfectly fine. We add 'xin' to make the sentence more formal.
Xin should not be required.
Xin cảm ơn is very formal and would sound strange in normal conversation. You would only use it you were speaking in front of a crowd or something
I've been to Vietnam and unless you are running a shop and talking to a customer, you don't speak like this