There has been numerous discussion recently about what should be done if a terrorist attack were to kill the President and many members of Congress. You don't want 4 remaining congresspeople running the government. At the same time, these are elected bodies and should be replaced by elected representatives.
So here's a thought. In the event of a substantial number of deaths (say the President and Vice President, over 10% of the Senate or House, and/or 3 members of the Supreme Court), the replacement works as follows.
To replace the President & Vice President, the nation's Governors meet with each holding the number of votes equal to their state's electoral vote, and elect a new President and Vice President from among themselves.
To replace a Senator, all member's of that state's Senate vote, and must elect a new Senator from among themselves.
To replace a Representative, all member's of that state's House who's district overlaps in any way with the congressional district must elect a new Representative from among themselves.
To replace a Supreme Court justice, the same thing with the members of the federal circuit courts voting.
In this manner, each replacement candidate is an individual that was elected to a comparable position, by the same voters in the case of the Senate & House, and is elected by people who themselves were elected.