Xixiasaurus is known from the mid-lower part of the Majiacun Formation of China, which dates to the Late Cretaceous period, but there has been disagreement about the exact geological age of the formation.
Lü and colleagues suggested the formation dated to the Campanian age, based on the similarity between Xixiasaurus and the Campanian genus Byronosaurus.
A Cenomanian to Turonian age for the formation had earlier been suggested based on spores, pollen, and dinosaur eggs; a Coniacian to Santonian age has been suggested as well, and Coniacian to Campanian or Santonian to Maastrichtian ages have been suggested based on bivalve fossils.
Some studies have also suggested that the formation is as old as Early Cretaceous.
The Majiacun Formation is represented by an 800–1,200 metres (2,600–3,900 ft) thick layer of brown and red sandstones, with muddier intervals of purple to green, or brown to red.
The lower and middle units of the formation are composed of sandstone, siltstone, and mudstone.
Eggs and eggshells are often found in the muddy siltstones.

The formations of the Xixia Basin are thought to be of continental origin (due to the absence of marine fossils), probably deposited by rivers and within lakes.
The Majiacun Formation itself is interpreted as representing deposits of braided streams and meandering streams.
The formation was part of the Yunmeng Lake drainage system during the Late Cretaceous.
The palaeoclimate of the Xixia basin is inferred to have been subtropical, sub-humid to sub-arid, based on the preponderance of C3 plants identified in the diet of the dinosaurs there (determined through isotopic study of egg shells).
Other dinosaurs from the formation include the alvarezsaurid Xixianykus, the hadrosauroid Zhanghenglong, an unnamed spinosaurid, ankylosaurid, and sauropods.
The discovery of abundant and diverse dinosaur eggs in Henan Province has been considered "one of the significant scientific events" in China.
Dinosaur ootaxa (taxa based on eggs) from the Majiacun Formation include Prismatoolithus (which may belong to troodontids), Ovaloolithus, Paraspheroolithus, Placoolithus, Dendroolithus, Youngoolithus, and Nanhiungoolithus.
Reptiles include turtles and crocodilians.
Invertebrates include the bivalves Plicatounio and Sphaerium and the clam shrimp Tylestheria (invertebrate trace fossils are also known).
Spores of plants such as Schizaeoisporites, Cicatruicosisporites, Lygodiumsporites, Cyathidites, Osmundacidites, and Pagiophyllumpollenites have also been identified.
Xixiasaurus is known from the mid-lower part of the Majiacun Formation of China, which dates to the Late Cretaceous period, but there has been disagreement about the exact geological age of the formation. Lü and colleagues suggested the formation dated to the Campanian age, based on the similarity between Xixiasaurus and the Campanian genus Byronosaurus. A Cenomanian to Turonian age for the formation had earlier been suggested based on spores, pollen, and dinosaur eggs; a Coniacian to Santonian age has been suggested as well, and Coniacian to Campanian or Santonian to Maastrichtian ages have been suggested based on bivalve fossils. Some studies have also suggested that the formation is as old as Early Cretaceous. The Majiacun Formation is represented by an 800–1,200 metres (2,600–3,900 ft) thick layer of brown and red sandstones, with muddier intervals of purple to green, or brown to red. The lower and middle units of the formation are composed of sandstone, siltstone, and mudstone. Eggs and eggshells are often found in the muddy siltstones.
The formations of the Xixia Basin are thought to be of continental origin (due to the absence of marine fossils), probably deposited by rivers and within lakes. The Majiacun Formation itself is interpreted as representing deposits of braided streams and meandering streams. The formation was part of the Yunmeng Lake drainage system during the Late Cretaceous. The palaeoclimate of the Xixia basin is inferred to have been subtropical, sub-humid to sub-arid, based on the preponderance of C3 plants identified in the diet of the dinosaurs there (determined through isotopic study of egg shells). Other dinosaurs from the formation include the alvarezsaurid Xixianykus, the hadrosauroid Zhanghenglong, an unnamed spinosaurid, ankylosaurid, and sauropods. The discovery of abundant and diverse dinosaur eggs in Henan Province has been considered "one of the significant scientific events" in China. Dinosaur ootaxa (taxa based on eggs) from the Majiacun Formation include Prismatoolithus (which may belong to troodontids), Ovaloolithus, Paraspheroolithus, Placoolithus, Dendroolithus, Youngoolithus, and Nanhiungoolithus. Reptiles include turtles and crocodilians. Invertebrates include the bivalves Plicatounio and Sphaerium and the clam shrimp Tylestheria (invertebrate trace fossils are also known). Spores of plants such as Schizaeoisporites, Cicatruicosisporites, Lygodiumsporites, Cyathidites, Osmundacidites, and Pagiophyllumpollenites have also been identified.
Xixiasaurus