Refactor the xml inteface