convert duration to hex when generating xml