A body cavity is a space between the gut tube (lined with endoderm) and the body wall (with its outer covering of ectoderm). Such a body cavity, or coelom, can be formed in two ways. A true coelom is formed within the mesoderm layer; thus, the true coelom is entirely lined with mesoderm.