read xml and format