xmlloader: cleanup, checks