Changed a lot of shit

Mostly involving the XML and DOM Tree Building