Exchange-traded funds offer a convenient way to invest in sectors or niches that interest you. If you'd like to add some oil and gas exploration and production companies to your portfolio, the SPDR S&P Oil & Gas Exploration & Production ETF (NYSEMKT:XOP) could save you a lot of trouble. Instead of trying to figure out which companies will perform best, you can use this ETF to invest in lots of them simultaneously.

The basics
ETFs often sport lower expense ratios than their mutual fund cousins. The SPDR ETF's expense ratio -- its annual fee -- is a low 0.35.

This ETF has performed  rather well, beating the world market over the past three and five years. As with most investments, of course, we can't expect outstanding performances in every quarter or year. Investors with conviction need to wait for their holdings to deliver.

Why oil and gas?
Oil and gas exploration and production companies are worth considering because despite growing interest in alternative energy, we're still quite dependent on good old oil and gas. More than a handful of oil and gas companies  had strong performances over the past year.

Marathon Petroleum (NYSE:MPC), spun off from Marathon Oil in June 2011, is up roughly 60% so far this year. It has some investors' expectations high because of its concentration on the promising Gulf and Midwest regions and its high capacity utilization. The company is buying a large refinery and other assets from beleaguered BP (NYSE: BP) for, reportedly, upwards of $2 billion. It's not necessarily a bargain right now, but some on Wall Street remain positive.

Phillips 66 (NYSE:PSX), the recently spun-off downstream business of ConocoPhillips (NYSE: COP), is the nation's largest independent oil refiner. Its stock has repeatedly hit 52-week highs, and it has initiated a dividend, yielding about 2.2%. Its stock is less of a bargain now, though, and its bears worry about competition and tight profit margins. Meanwhile, the oil prices have fallen recently, sending the stock down a bit.

Other companies didn't do as well last year but could see their fortunes change in the coming years. EXCO Resources (NYSE:XCO) sank 36%, saddled with debt and whacked by very low natural-gas prices. It's also not shifting its focus from gas to oil, as many peers are. On a valuation basis it looks attractive, but it's fair to say that there are other companies with less uncertain futures worth considering instead.

Oil and gas company Ultra Petroleum (NASDAQOTH:UPLMQ) has been a mixed bag for investors, averaging  19% annual gains over the past decade, but 20% annual losses over the past five years. Like its peers, it has been whacked by a natural-gas glut, though its being a low-cost producer has helped. A cold winter with rising gas prices could give it a big boost, but in the meantime, it's saddled with a lot of debt.

The big picture
Demand for oil and gas isn't going away anytime soon. A well-chosen ETF can grant you instant diversification across any industry or group of companies -- and make investing in and profiting from it that much easier.

Longtime Fool contributor Selena Maranjian, whom you can follow on Twitter, has no positions in the stocks mentioned above. The Motley Fool owns shares of Ultra Petroleum and has options on Ultra Petroleum. Motley Fool newsletter services recommend Ultra Petroleum. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.