The sea urchin larval gut is a tripartite structure consisting of an esophagus, a stomach and an intestine. The morphological changes driving the formation of the functional larval gut are well described; however, very little is known about the molecular toolkit responsible for the differentiation of the gut and the final gain of digestive functions. In this study I focused on the transcription factors that determine the differentiation of two of the gut compartments, the stomach and the intestine. Two TFs play a key role: SpLox, whose vertebrate homologue is known for its essential role in the development and functioning of the pancreas, appears as a main regulator of stomach differentiation in the sea urchin and it is necessary for the acquirement of its digestive functions; SpCdx acts as a strong repressor of the stomach fate in the hindgut cells and it is responsible of proper intestine differentiation. I investigated the role of these two genes by functional analysis with a dual approach, studying the effect of perturbation of their upstream regulators and investigating their role in controlling gut specific terminal differentiation genes: the obtained net of gene regulatory inputs has been schematized in a Biotapestry diagram allowing a simple and immediate representation of some of the crucial gene interactions happening during sea urchin endoderm specification and differentiation processes. In this contest I analyzed retinoic acid putative role in the sea urchin embryonic development, discovering that exogenous treatments with this molecule determine a change in transcripts distribution along the antero-posterior axis of the gut: this represents the first example outside chordates of RA machinery function in development. Moreover, I extended the analysis of the GRN to another class of Echinoderrns, the Asteroidea Patiria miniata, aiming to assess the level of conservation of gene expression and function of the orthologue genes investigated in the sea urchin. With the same gene perturbation approach I found a total absence of conservation at the GRN level despite the very impressive conservation observed in the expression domains. The obtained two networks have been finally examined in a comparative perspective with the available data in vertebrates, analyzing the level of conservation and divergence between echinoderm and vertebrate gut patterning processes and providing a very powerful tool to decipher the changes in gene activities that over evolutionary time have shaped structures like the embryonic gut.