Authors:D'Angelo et alAbstract:We present formation simulations of the six Kepler 11 planets. Models assume either in situ or ex situ assembly, the latter with migration, and are evolved to the estimated age of the system, 8 Gyr. Models combine detailed calculations of both the gaseous envelope and the condensed core structures, including accretion of gas and solids, of the disk's viscous and thermal evolution, including photo-evaporation and disk-planet interactions, and of the planets' evaporative mass loss after disk dispersal. Planet-planet interactions are neglected. Both sets of simulations successfully reproduce measured radii, masses, and orbital distances of the planets, except for the radius of Kepler 11b, which loses its entire gaseous envelope shortly after formation. Gaseous (H+He) envelopes account for < 18% of the planet masses, and between 35 and 60% of the planet radii. In situ models predict a very massive inner disk, whose solids' surface density (sigma_Z) varies from over 1e4 to 1e3 g/cm2 at stellocentric distances 0.1 < r < 0.5 AU. Initial gas densities would be in excess of 1e5 g/cm2 if solids formed locally. Given the high disk temperatures (> 1000 K), planetary interiors can only be composed of metals and highly refractory materials. Sequestration of hydrogen by the core and subsequent outgassing is required to account for the observed radius of Kepler 11b. Ex situ models predict a relatively low-mass disk, whose initial sigma_Z varies from 10 to 5 g/cm2 at 0.5 < r < 7 AU and whose initial gas density ranges from 1e3 to 100 g/cm2. All planetary interiors are expected to be rich in H2O, as core assembly mostly occurs exterior to the ice condensation front. Kepler 11b is expected to have a steam atmosphere, and H2O is likely mixed with H+He in the envelopes of the other planets. Results indicate that Kepler 11g may not be more massive than Kepler 11e.