We wrote last week that even if the White House and Congress reach an agreement to raise the federal debt ceiling, U.S. Treasury bonds could easily lose their triple-A rating in the future.

So would that downgrade impact municipal bonds? Yes, quite a bit. The question is, how do you pick munis for your portfolio while worrying about a potential downgrade?

American ratings agencies have warned that if they end up downgrading U.S. government bonds, many municipal-bond ratings will be cut automatically as well. In fact, thousands of bonds could be downgraded.

There are about 45,000 municipal-bond issues in existence, with a market value of about $1.3 trillion, according to June 30 data from JPMorgan Chase & Co. About 7,000 are pegged to the same rating as U.S. Treasurys, and those issues could be downgraded in lockstep by the three key ratings agencies - Fitch Inc., Moody's Corp., and Standard & Poor's.

That might prompt you to ditch municipal bonds outright - but that would be a mistake.

Some munis might actually do extremely well, because the individual states or authorities issuing them

are in excellent financial health. And though yields have fallen to historic lows when compared with Treasurys, muni-bond

yields are still generally slightly higher. Yields on munis fell to 3.49 percent at the end of the second quarter from 3.8 percent

at the end of 2010. The current yield on a 10-year Treasury is 3.18 percent, according to Barclays Capital.

South Carolina's top officials described perfectly the impact a U.S. Treasury bond downgrade could have on muni bonds nationwide: "The federal debt situation will have a ripple effect across all 50 states if Congress does not act to balance the budget and stop spending far more than it takes in," State Treasurer Curtis Loftis said Wednesday after learning South Carolina could lose its triple-A rating from Moody's.

South Carolina Gov. Nikki Haley, a Republican, blamed the White House and Congress for the threat of a municipal credit downgrade in her state. Washington "is dysfunctional, and now the fiscal chaos is threatening South Carolina's credit rating," Haley said. "That's absolutely unacceptable. President Obama needs to lead - it's time for him to work with Congress to pass real, long-term spending cuts and let our economy get moving."

Moody's Investor

Service warned last week that if the federal government defaulted on the nation's debt, the service would likely lower its gold-plated triple-A ratings for five states: Maryland, New Mexico, South Carolina, Tennessee, and Virginia.

So which muni could hold up better? Only a few states - including Delaware, Georgia, Maryland, and Virginia - have top bond ratings for their taxpayer-covered, general-obligation bonds from all three ratings agencies.

New Jersey is among the top 10 municipal-bond issuers with the widest spreads for 10-year bonds over the Municipal Market Data's benchmark triple-A scale. That means investors buying Jersey munis are being paid more in yield over the standard muni-bond index because they are taking on more risk. New Jersey was downgraded to AA-, the fourth-highest level, from AA, by Standard & Poor's, which cited the state's growing pension and health-care obligations.

New Jersey's munis were paying 0.50 percent more in yield over the benchmark. Nearly bankrupt California was paying 0.89 percent and Illinois a whopping 1.60 percent over the index.

That higher yield is understandable because New Jersey is facing an unfunded pension liability of $37 billion and already has about $32 billion in bonds outstanding.

Pennsylvania is in better shape; it just enacted a balanced budget, and Moody's rates it Aa1. However, individual cities - think Harrisburg - are fending off bankruptcy, and their muni bondholders could take a haircut as a result.

Separately, Moody's also named its 10 top-rated states as less vulnerable to downgrades: Alaska, Delaware, Georgia, Indiana, Iowa, Missouri, North Carolina, Texas, Utah, and Vermont.

Now that you know which states are likely to hold up better - even with a U.S. Treasury downgrade - be careful in buying individual muni bonds. Brokers of muni bonds are notorious for "markups" on the price, since many munis rarely trade.

If you choose to buy individual muni bonds, first check the Municipal Securities Rulemaking Board's Electronic Municipal Market Access website - (http://emma.msrb.org/Search/Search.aspx).

Erin Arvedlund is a finance reporter and resides in Philadelphia. Contact her at erinarvedlund@yahoo.com or

at 646-797-0759. Read more

of her columns at www.philly.com/arvedlund.