Massive optimisation patch

A lot of the XML is now also a lot tidier and significantly less verbose