Both Wal-Mart and Exxon Mobil managed to weather the economic storm raging in the U.S. and keep their respective positions at the top of the annual Fortune 500 list of the nation’s largest publicly traded companies, but GM couldn’t hold onto its third spot and ended up slipping down a position to fourth. Taking its place in the top three was oil company ChevronTexaco, which moved into the third spot on the back of rising energy costs.

The annual list is based on companies’ 2007 revenues, which is why Wal-Mart could keep its top spot despite earning less profit than Exxon Mobil. Wal-Mart took in $378.8 billion in revenue last year, up 7.9% compared with 2006, and had $12.7 billion in profits. Exxon Mobil was a close second with $372.8 billion in revenues and $40.6 billion profit, reports the Detroit Free Press.

Flagging U.S. auto sales and a $38.7 billion loss in 2007 saw GM’s revenues drop to $182.3 billion for the year. Despite the turmoil Ford managed to keep its number seven position.