From what I understand, after the collapse of the Western Roman Empire, Germanic kingdoms (Franks, Ostrogoths, Visigoths, Burgundy etc) ruled countries that today speak Latin-based languages, even though back then they spoke Germanic languages. My Latin teacher told us that English has Latin-based words through French which was carried over by the Normans after their conquering of England and French assimilation into the upper class. But that was in the 11th century, over 600 years after the Roman empire collapsed and Germanic tribes migrated into their areas, pushed in by the Huns. How then is it that the German languages died out in these areas while Latin survived transformed into the Romance languages over such a long period of time?
The ruling class speaking a Germanic language is not the same thing as the common people doing it. Those places were always dominated by Romance languages.
The Visigoths ruled Spain but the common people still spoke vulgar Latin. The result was just that what-was-to-become-Spanish got a lot of Gothic loanwords. Similarily, English got a lot of loanwords from French through the Normans. But English is still a Germanic language.
The 'barbarian' invaders who parceled up the Western Roman Empire had had a lot of experience inside the empire before they set up their own kingdoms, and seem to have been very comfortable working in Latin. Remember that they were, themselves, part of the Roman government system before it broke apart - Alaric and his Goths, for example, were a unit of the Roman army (and may not have even existed as a people group before banding together to serve as foederati soldiers), as were the Franks and other barbarian 'peoples'.
When these Roman military groups took over the empire, they often continued to use Latin. The first barbarian law code was written by Euric (a 'Visigoth', in the 5th century), but it was written in Latin (and seems to have borrowed many of its ideas from Roman legal precedents). The Frankish law codes (starting in the 6th century) were also written in Latin, not a Germanic language. In fact, the only barbarian laws that weren't written in Latin were the Anglo-Saxon laws, but they were written much later (around the turn of the 7th century) and, of course, in the one part of the Western empire that did end up speaking a Germanic language long-term. So Latin appears to have served not only as the language of the many 'Romans' whom the barbarians conquered; it was also important in the administrative systems that the (heavily Romanized) 'barbarians' instituted to replace Roman government.
That doesn't mean the Germanic languages didn't have any effect on the linguistic landscape of Europe - barbarian names became very common in Gaul, and a number of Germanic loan words appeared in Latin (much like American English has a lot of words borrowed from Spanish).