parse xml and generate xml