I dont think there is a problem with Nationalism, this is the thing that ISIS and the like is thinking since they see us all as Non-Islamic by seeing there are many Muslim nations. The essence is how to manage those nations in order to find unity, because of that there is a need to create a very effective and just institution to do that.
Nationalism is actually something similar like Arab Tribes during Madinah rule, there is nothing wrong about it as long as all the tribes get united in one banner for a strategic issue like foreign policy and military action. Even between Quraish there are faction (Hashimi/ Muawiyah/Abbas) and Anshar ( 2 tribes / I forget) in which each of them try to seek power during Madinah rule. As Islam spreads, so it is inevitable to see such nationalism exist, I can say it should be seen as Sunnatullah, so eliminating this thing is against our own nature.
The truth is that ISIS/TTP/Taliban wants to rule as like as Madinah rule (First Four Chalip) since they see that it is How Islamic nation should be, heck that time Muslim lacks of modern democratic institution that later create huge problem in the time of Khalifah Ali Bin Abi Thalib that later create war that killed 20.000 Muslim troops that later weaken Ali position and bring Muawiyah (Family ruling) Empire to rule the entire Muslim areas for 100 years.
So, never afraid of Nationalism, it is Institution that needs to create to manage it.