We consider the deterministic generation of entangled multiqubit states by the sequential coupling of an ancillary system to initially uncorrelated qubits. We characterize all achievable states in terms of classes of matrix-product states and give a recipe for the generation on demand of any multiqubit state. The proposed methods are suitable for any sequential generation scheme, though we focus on streams of single-photon time-bin qubits emitted by an atom coupled to an optical cavity. We show, in particular, how to generate familiar quantum information states such as W, Greenberger-Horne-Zeilinger, and cluster states within such a framework. For this purpose, a lot of effort has been made in recent years to develop efficient and deterministic single-photon sources [4 -7].Photonic multiqubit states can be generated by letting a source emit photonic qubits in a sequential manner [8]. If we do not initialize the source after each step, the created qubits will be, in general, entangled. Moreover, if we allow for specific operations inside the source before each photon emission, we will be able to create different multiqubit states at the output. In fact, this is a particular instance of a general sequential generation scheme, where an ancillary system is coupled in turn to a number of initially uncorrelated qubits.It is the purpose of this Letter to provide a complete characterization of all multipartite quantum states achievable within a sequential generation scheme. It turns out that the classes of states attainable with increasing resources are exactly given by the hierarchy of so-called matrix-product states (MPS) [9,10]. These states typically appear in the theory of one-dimensional spin systems [11], as they are the variational set over which density matrix renormalization group techniques are carried out [12]. Thus, our analysis stresses the importance of MPS, since we show that they naturally appear in a completely different and relevant physical context. Moreover, particular instances of lowdimensional MPS, like cluster states [13] or GreenbergerHorne-Zeilinger (GHZ) states [14], are a valuable resource in quantum information [15]. Conversely, we will provide a recipe for the generation on demand of any multiqubit state within a sequential generation scheme. Because of the general validity of these results, we will first state and prove them without referring to any particular physical system. This will be then applicable to all sequential setups, like streams of photonic qubits emitted either by a cavity QED (CQED) source [4,5] or by a quantum dot coupled to a microcavity [6,7].In the second part, we will focus on the physical implementation of these ideas within the realm of CQED. The role of the ancillary system will be performed by a D-level atom coupled to a single mode of an optical cavity. The sequentially generated qubits will be time-bin qubits j0i and j1i, describing the absence and presence of a photon emitted from the cavity in a certain time interval (see Fig. 1).We will concentrate on setups...