restructure xml and content formatting