Surely it is usually both. 'Over-identification' with the group is very common among adolescents.
The term for extreme nationalism is nativism, which can lead to racism.
Nazi
Hitler
Italian fascism
Adolf Hitler
words that end in ism is optimism and journalism
Put simply fascism is a typically a policy of belligerent nationalism and racism, it is therefore against people who are perceived (by the government or party) to be foreign.
The word 'xenophobia' is a combination of two words meaning 'fear of strangers'. Xenophobia occurs wherever there is racism, prejudice, nationalism or just plain, old fear of the unknown.
a governmental system led by a dictator having complete power, forcibly suppressing opposition and criticism, regimenting all industry, commerce, etc., and emphasizing an aggressive nationalism and often racism.
Institutional racism
Hitler's political views evolved over his career, but he maintained beliefs in anticommunism, antisemitism, and the expansion of Germany and it's people.
Assata Shakur has written: 'Assata' -- subject(s): African Americans, Biography, Black Panther Party, Black nationalism, Race relations, Racism, Black Feminism