Demyx wasn't killed in his last battle with Sora. He warped away in a flash of water and bubbles, unlike the other Organization XIII members. Etna found him and talked him into joining the Shadow Force. After he found out that Organization XIII came back, he went back to them as a double agent for Etna. After the Shadow Force battled Dark Gabriel, he was lost. Gabriel found him and Demyx is now working for him, or so Gabriel thinks. Demyx is still working for Etna.