The light didn't kill Xehanort's Heartless, it just caused him to become a more dormant presence within Riku. Also, the darkness and Heartless were all in the Realm of Darkness. That wasn't Kingdom Hearts but, the Door to Darkness. We have yet to see Kingdom Hearts in the series so for.
The light wouldve come from KH though.