Yes, what I meant was, it's not supposed to be closed THERE..... I closed it right after the xlmns code which is why it didn't work. And yea, that was definitely one of the big errors.
So correction for those having the issue, it's supposed to be closed, but after the piece of php coding :)
And yea, me too, it was irritating as hell!