The son of Félix de Mérode-Westerloo who held successively the portfolios of foreign affairs, war, and finances under Leopold I of Belgium, and of Rosalie de Grammont, he was allied through the Mérode family to the aristocracy of France. Losing his mother at the age of three, Xavier was brought up at Villersexel, in Franche-Comté, by his aunt Philippine de Grammont.
He attended for a time the Jesuit College of Namur, then entered the Collège de Juilly presided over by de Salinis, whence he passed (1839) to the Military Academy of Brussels. Graduating with the rank of second lieutenant, after a short service at the armoury of Liège, he joined (1844) as foreign attaché the staff of Maréchal Bugeaud in Algeria, winning the cross of the Légion d'honneur.
In 1847, he abruptly resigned the military career and went to study for the priesthood in Rome, where he was ordained (1849). Assigned, after his ordination, as chaplain to the French garrison of Viterbo, he was being pressed by his family to return to Belgium when Pope Pius IX, with a view to attach him permanently to his court, made him cameriere segreto (1850), an office which entailed the direction of the Roman prisons. The work done by de Mérode for the penitentiary system in Rome is described by Lefebvre and Maguire; de Rayneval, the French envoy at Rome, praised it in an official report to his government; Joachim Pecci, Archbishop of Perugia, wanted the young cameriere to inaugurate similar work in his metropolis.
In 1860 de Mérode, much against the views of the Roman Prelature, headed by Cardinal Antonelli, persuaded Pius IX to form a papal army and succeeded in enlisting the services of Lamoricière as commander-in-chief and was himself appointed minister of war. The task assumed by de Mérode and Lamoricière was well-nigh impossible.
The ensuing years of comparative quiet de Mérode spent in public works; the building at his own expense of the campo pretoriano outside the Porta Pia, the clearing of the approaches of Santa Maria degli Angeli, the opening of streets in the new section of Rome, the sanitation of the old quarters by the Tiber, etc. His temperament and progressive views made him enemies among the old traditional Roman element just as the vehemence with which he branded the French Emperor's duplicity turned against him the heads of the French army of occupation. Lamoricière's death (19 September, 1865) became the signal of open hostility. Pius IX was forced to discharge his minister.
Reduced to a simple cameriere, de Mérode, on Hohenlohe's promotion to the cardinalate, was given the vacant place of papal almoner and (22 June, 1866) consecrated titular Archbishop of Melitene. His new duties were to distribute the papal alms and to confirm children in danger of death. At the First Vatican Council, he showed the influence exercised over him by his brother-in-law, de Montalembert, and sided with the minority that deemed the definition of papal infallibility inopportune and even dangerous, but submitted the day the dogma was defined.
After the capture of Rome by the Piedmontese (20 September, 1870) he followed his master into the retirement of the Vatican, leaving it only to fight the Piedmontese government's pretensions on the campo pretoriano or to share de Rossi's work in the excavations of Tor Marancino which resulted in the discovery of the Basilica of St. Petronilla.
He died of acute pneumonia in the arms of Pius IX, only a few months before the Consistory in which he was to have been made a cardinal. His remains were laid to rest in the Flemish Cemetery near the Vatican.