Expansion files are loaded after the vanilla. Many 'base game' definitions are still located in the vanilla files. Expansion files re-write over their equivalent vanilla files as necessary.
In BNW as a general rule there will be up to three similarly-named files for one type of game element. For buildings, there is Civ5Buildings.xml, Civ5Buildings_Inherited_Expansion2.xml, and Civ5Buildings_Expansion2.xml. Items for Buildings and Wonders that were added in Vanilla are located in Civ5Buildings.xml and any changes to Vanilla buildings and wonders are contained therein. Items for Buildings and Wonders that were added in G&K are located in Civ5Buildings_Inherited_Expansion2.xml and any changes to G&K buildings and wonders are contained therein. Civ5Buildings_Expansion2.xml will contain the stuff added new in BNW. This is the general pattern adhered to by Firaxis. But Firaxis is never 100% consistent about anything, so this is only a general rule to understand where to find the relevant XML for BNW. DLC info is found in additional DLC subfolders for each of the expansions (these are located under the over-all expansion subfolder), so you will find nothing about Walls of Babylon in BNW in the three files mentioned earlier -- Walls of Babylon will be found in the XML folders for the Babylon DLC (sorry I can't remember off the top of my head which DLC Babylon is in).
Adding to the fun of understanding where things are in the XML files is the fact that in BNW, Firaxis was inconsistent in their methods. Austrian Hussars, for example, are mentioned nowhere in the three BNW "Units" files. But if you have both G&K and BNW, when playing BNW you still have Austrian Hussars in-game. This is because the Hussars are defined in G&K and 'left alone' by the BNW code. Which is fine in and of itself, but inconsistent with the methods used for 90+% of all the other units.
All this fun and 'consistency' is a big reason why many of us recommend downloading one of the free SQL database viewer programs, and only working directly with what is actually implimented into the game's SQL database rather than trying to hunt-peck-browse through all the hash of game-file arrangement and organization. Though I still maintain there is no superior method for understanding the structure of the game's basic elements (such as buildings, units, promotions, policies, techs) than opening the relevant XML files and studying the table definitions as used by the game, and as used for a particular expansion-level.