Tidy up source XML