I have a naive question about foundations of mathematics. A common opinion of most mathematicians is that the essential part of mathematics can be reduced to ZF(C) axioms. I do not quite understand one of basic steps of this reduction. How to define rigorously an intuitive concept of "a finite sequence of arbitrary length consisting of arbitrary sets", in other words a concept of a sequence $X_1,X_2,\dots X_n$ where all $X_k$ are arbitrary sets. A difficulty here is that usually a finite sequence $y_1,\dots y_n$ (i.e. a list) is defined as a function from the segment $\{1,\dots n\}$ to some set $Y$ (i.e. as a sequence of elements of some set) but if we want to deal with arbitrary sets $X_k$ we do not have a priory such a set $Y$.
More specifically, is it possible to formulate the following intuitive theorem as a single formula of ZF: "for any finite sequence of countable sets $X_1,\dots X_n$, their union is countable" or such a theorem can be realized in ZF only as a kind of theorem scheme?
Edited after receiving first answers: Thanks everyone for explanations! As far as I understand now, everything depends on the definition of a function which is used. The problem described in my question appears if one uses the traditional definition of a function as a binary relation having functional property (as presented, e.g. in Wikipedia) because the domain and codomain must already exist as sets before we obtain a function according to this definition. But if we use another definition of a function as an arbitrary set of ordered pairs which satisfies functional property (see the comment of Max), we have no problems!
That's not an issue. It is true that there is no set of "all finite sequences of countable sets". But this is a theorem.
If $f$ is a finite sequence of countable sets, this means that $f$ is a function, whose domain is some $n<\omega$, and for each $i<n$ we have that $f(i)$ is a countable set.
Using the axiom of replacement, $\{f(i)\mid i<n\}$ is a set as well, so $\bigcup\{f(i)\mid i<n\}$ is again a set. And we claim that it is countable.
This is no more a schema, than "Every even number can be realized as the sum of two primes" is a schema in the language of first-order arithmetic. And of course it's not a schema.