Reworked XML parsing and loading.