In a world unnerved by terrorism, it is not the principle of democracy which is under threat. A sort of war is going on, sometimes conducted by repulsive groups with appalling methods. But this is a war against United States power in the world - and the power of America's military allies.
This struggle began before 11 September 2001, and will continue in a multitude of forms, not all of them violent. The crime of 11 September was an attack on a nation state. This atrocity was not planned as an attack on representative democracy. That was a rallying slogan which came later, from politicians and the media. Why, then, did so many Americans come to accept that democracy itself was the target?
American patriotism is essentially institutional. It has traditional nationalist components - the flag, the assumption of cultural superiority and so forth - but the Constitution is the ark of the covenant. Its principles are claimed to be not national but universal, in the old Enlightenment way. That implies that all humans are loyal to those principles, even if they may not be aware of it. So, if US territory or citizens are attacked, democracy, by definition, is attacked too
It's just one more version of Great-Power solipsism: what's good for my nation is good for the world. We have had that from old-fashioned German nationalists, from Victorian British imperialists - it's a long list. Democracy, then, is not in direct danger from terrorism, unless we are crass enough to elide the distinction between the security of the United States and democratic practice in the rest of the world.