Well after doing a lot of research and getting very lucky I found out why it was doing that.. It was a problem with my php configuration.
Apparently for windows users you want to disable the php_domxml.dll extension which is enabled by default in some WAMPs such as XAMPP. (dono bout linux users)
Just thought I'd let you know if anyone else is having this problem.