Fix bug on generate xml