Reading from xml and writing in progress