Food webs are descriptions of who eats whom in an ecosystem. Although extremely complex and variable, their structure possesses basic regularities. A fascinating question is to find a simple model capturing the underlying processes behind these repeatable patterns. Until now, two models have been devised for the description of trophic interactions within a natural community. Both are essentially based on the concept of ecological niche, with the consumers organized along a single niche dimension; for example, prey size. Unfortunately, they fail to describe adequately recent and high-quality data. Here, we propose a new model built on the hypothesis that any species' diet is the consequence of phylogenetic constraints and adaptation. Simple rules incorporating both concepts yield food webs whose structure is very close to real data. Consumers are organized in groups forming a nested hierarchy, which better reflects the complexity and multidimensionality of most natural systems.