fixed ALL warnings and all but 2 xmlelement leaks