fixed remake xml function.