We study a generic model of self-assembling chains which can branch and form networks with branching points (junctions) of arbitrary functionality. The physical realizations include physical gels, wormlike micells, dipolar fluids and microemulsions. The model maps the partition function of a solution of branched, self-assembling, mutually avoiding clusters onto that of a Heisenberg magnet in the mathematical limit of zero spin components. Regarding thermodynamics properties as well as scattering strucuture factor, the mapping accounts rigorously for all possible cluster configuration, except for closed rings. The model is solved in the mean field approximation. It is found that despite the absence of any specific interaction between the chains, the presence of the junctions induces an effective attraction between the monomers, which in the case of three-fold junctions leads to a first order reentrant phase separation between a dilute phase consisting mainly of single chains, and a dense network, or two network phases. The model is then modified in order to predict the structural properties on the mean field level. Independent of the phase separation, we predict the percolation (connectivity) transition at which an infinite network is formed. The percolation transition partially overlaps with the first-order transition. The percolation transition is a * e-mail:anton.zilman@weizmann.ac.il 1 continuous, non thermodynamic transition that describes a change in the topology of the system but not a thermodynamic phase transition. Our treatment which predicts both the thermodynamic phase equilibria as well as the spatial correlations in the system allows us to treat both the phase separation and the percolation threshold within the same framework. The density-density correlation correlation has a usual Ornstein-Zernicke form at low monomer densities. At higher densities, a peak emerges in the structure factor, signifying an onset of medium-range order in the system. Implications of the results for different physical systems are discussed.