Airline stocks have been some of the market's top performers in the past two years. With investor interest in airline stocks higher than it has been in many years, it's a great time for privately held airlines to go public -- in order to raise money or to allow existing shareholders to cash out.

Last week, Virgin America announced plans for its long-awaited IPO. The Virgin America IPO should allow the company to improve its capital structure and support its planned growth for the next few years.

Virgin America announced plans for an IPO on Monday. Source: Virgin America.

Virgin America has been rapidly improving its profitability recently, making its stock potentially attractive -- depending on the price. Another source of possible upside is buyout potential. Because of its strong position in San Francisco and Los Angeles (two strategically valuable markets) Virgin America may ultimately be acquired by one of its larger competitors.

Virgin America prepares for an IPO
On Monday, Virgin America, one of the country's youngest airlines, announced that it has filed a registration statement with the SEC in preparation for an IPO. Most of the details of the IPO -- including the date, price, and number of shares to be sold -- still need to be finalized. Nevertheless, this announcement puts Virgin America on track to go public before the end of 2014.

The company's management has been talking about an IPO for quite some time. However, Virgin America was unprofitable for each of its first six years of operation (2007-2012) as it grew rapidly from a start-up to a billion-dollar company. This made any IPO plans premature.

Last year was pivotal in setting Virgin America up to go public. In 2013, the company finally halted its growth, with full-year capacity down 2.2% year over year. This helped it post its first annual profit, earning $10.1 million. While this represented a razor-thin 0.7% profit margin, it marked a huge improvement from the company's 2012 margin of negative 10.9%.

Last November, CEO David Cush stated that if Virgin America was profitable in Q4 2013 and Q1 2014 (seasonally weak periods), it would be ready for an IPO by the end of 2014. Indeed, Virgin America expects to produce a profit margin in the top half of the airline industry this year.

The airline didn't quite meet that goal: It lost $22.4 million in Q1 due to headwinds from the shift of Easter into April and an unusual number of weather-related flight cancellations, especially around Presidents' Day. Still, Virgin America appears to be on pace for another year of strong profit improvement in 2014.

An organic route to profit growth
Virgin America's rapid profit improvement in the last 18 months shows that its high-tech feel and focus on customer service are winning over travelers. As its relatively young route network continues to mature, profit margins should continue to widen.

Virgin America also has an intriguing opportunity to boost margins by redeploying some of its capacity later this year. The carrier won a three-way race to gain control of two gates that American Airlines was required to divest at Dallas Love Field.

Virgin America won the right to take over American's gates at Love Field. Source: American Airlines.

Virgin America will use these gates to launch service this fall to New York's LaGuardia Airport and Washington's Reagan National Airport. In early 2015, it will add service to Chicago. Virgin America is freeing up aircraft for these routes by dropping less profitable flights between Los Angeles and San Jose and from Philadelphia to San Francisco and Los Angeles.

It will also move its San Francisco and Los Angeles flights from the much larger Dallas-Fort Worth International Airport to Love Field in October. American Airlines runs a massive hub in Dallas-Fort Worth, so Virgin America is likely to achieve better results by differentiating itself with flights to the smaller and more convenient Dallas Love Field.

The buyout route
While Virgin America certainly appears to be strong enough to stand on its own, it could also be an intriguing M&A target. It has a solid foothold in San Francisco and Los Angeles, the two top markets on the West Coast, which could be appealing for other airlines.

JetBlue Airways is by far the most likely suitor. First, like Virgin America, the Airbus A320 is the mainstay of its fleet. Second, both carriers routinely score the highest marks in the industry for various customer service metrics. For the last two years, Virgin America and JetBlue have come in No. 1 and No. 2 in the annual Airline Quality Rating report.

JetBlue could be interested in buying Virgin America eventually. Source: JetBlue Airways.

Buying Virgin America would also improve JetBlue's geographical diversification. Today, most of JetBlue's focus cities are on the East Coast -- the only exception is a small focus city at Long Beach Airport, where JetBlue is limited to operating a few dozen daily flights. By contrast, Virgin America's main bases are San Francisco and Los Angeles.

San Francisco and Los Angeles would both be good growth markets for JetBlue. JetBlue regularly talks about focusing its growth on "high-value geography." San Francisco and Los Angeles clearly fit that description -- and it would be much easier to buy a strong position there than to try to build one organically.

Foolish conclusion
After a rocky period of rapid growth, Virgin America is quickly maturing into a stable, solidly profitable airline. As it continues to refine its network by dropping less profitable routes and adding service in more promising markets like Dallas, Virgin America should produce significant margin growth.

This alone makes it an intriguing investment opportunity. However, the potential for a buyout by fellow "hybrid" carrier JetBlue or another competitor is also a compelling reason to consider investing in Virgin America (depending on the IPO price). Virgin America's loyal and growing customer base in California should make it an attractive takeover target almost as soon as it completes its IPO.