Forum:How does xehanort become a heartless?

Alright, so I know at the end of KH: BBS, Terra/Xehanort "locks" his heart and then falls into darkness, resulting in aqua sacrificing herself to save him. So when he comes back up, he lost all his memories and is lost. When he locked his heart, did that create his heartless?

I haven't played this game in a while, but I'm getting back into it. So, also what happens to Xehanort? I'm going through KH 2 right now and I have failed to see him, I just got into Ansem the wise's computer lab. Also, if xehanort dies, then so does Terra, right? So then, if my limited knowledge is correct, then it will throw off the entire KH 3 plot, cause Sora is gonna try to go rescue Ansem the wise, aqua and Ven, if my guess is correct.

Also, why does he call himself Ansem?