We generalize the entanglement swapping scheme originally proposed for two pairs of qubits to an arbitrary number q of systems composed from an arbitrary number mj of qudits. Each of the system is supposed to be prepared in a maximally entangled state of mj qudits, while different systems are not correlated at all. We show that when a set ∑j=1qaj particles (from each of the q systems aj particles are measured) are subjected to a generalized Bell-type measurement, the resulting set of ∑j=1q(mj−aj) particles will collapse into a maximally entangled state