Updated to handle XML file replacements in Compile stage