It's been a turbulent year for transportation and shipping stocks, rocked by trade wars and fears of a global slowdown, but aided by manageable fuel costs and the resilience of the U.S. consumer.

XPO Logistics (XPO 0.61%) and Werner Enterprises (WERN 0.14%) are two well-run transport companies occupying different, but sometimes overlapping, parts of the supply chain. XPO focuses on logistics and freight management while Werner operates one of the nation's largest fleets of trucks and trailers.

A truck driver looking out from his cab.

Image source: Getty Images.

Both companies have weathered the tariff talk relatively well. That said, there is at least some reason for continued concern as near-term macroeconomic conditions could slow momentum throughout the sector, and at these companies specifically.

Here's a look at where things stand with both XPO and Werner to determine which, if either, is the better buy today.

XPO Logistics: Returning to M&A soon?

Longtime highflier XPO has come crashing back to earth in the past year. CEO and roll-up specialist Bradley Jacobs used mergers and acquisitions (M&A) to build the company from a $177 million-sales trucking brokerage to a $17 billion global shipping giant in less than a decade. The strategy produced a 3,000% return over a 10-year period, ending in mid-2018.

But the stock hit the brakes last year and was thrown into reverse as XPO faced a series of obstacles. It started in October 2018, when the company was targeted by short-seller Spruce Point Capital. Its woes continued in February when XPO missed earnings, due in part to its largest customer taking its business elsewhere. Soon after, XPO appeared to signal it was taking a pause from dealmaking and potentially changing the investment thesis for the company.

An XPO truck driving in an urban environment.

Image source: XPO Logistics.

That large customer is believed to be Amazon.com and part of the reason for the divorce was XPO's effort to court other e-commerce companies via its XPO Direct service. XPO Direct is a suite of products, including warehousing and last-mile delivery, that helps even the playing field between Amazon and its rivals. It provides those customers with logistics at a scale that few besides Amazon can afford to do on their own.

Since February, XPO has been making the case that the worst is behind it, but without a return to M&A there are likely limits on how much higher the stock can soar. Jacobs has hinted of late that a return to dealmaking could be right around the corner. He told a Morgan Stanley conference in September that he is now spending up to 15% of his time exploring possible acquisitions.

On Oct. 16, the company named Aris Kekedjian, a one-time top dealmaker at General Electric, to its board, another apparent sign that mergers are again on XPO's agenda. Dealmaking can be fraught with perils, and in some cases serial acquirers can run into trouble. But given Jacobs' history, with more than 500 deals spread across XPO and two previous roll-ups, and XPO's overall acquisitions success throughout the years, it is a risk I'll gladly accept as an XPO shareholder.

Werner Enterprises: A steady ride

Werner is a more traditional trucking company. It ranks as one of the five largest truckload carriers in the U.S. with a portfolio of services including long-haul, regional, expedited deliveries, and temperature-controlled trailers. Truckload companies focus on moving full trailer loads for customers, as compared to less-than-truckload shipping in which the freight of numerous customers is consolidated into one trailer.

Although Werner's core business is much more asset-heavy than that of XPO, the company does offer a suite of logistics which includes freight brokerage, management, intermodal, customs, and freight forwarding. Asset-light operations account for about 20% of total revenue.

Werner has also done a good job nurturing a customer base that is less exposed to cycles. The bulk of its revenue comes from consumer nondurables including groceries that need its services in good times and bad. About half of its fleet runs on long-term dedicated contracts with specific customers.

Shares of the company have been volatile, trading up and down with the talk of tariffs and trade deals, but Werner outperformed both the S&P 500 and XPO shares over the past year.

WERN Chart

WERN & XPO data by YCharts

Company CEO Derek J. Leathers said that after a difficult first half of 2019, the truckload market is seeing expected seasonal improvements. Speaking at that same Morgan Stanley conference, he said believes there will be opportunities for large, established truckers like Werner to gain share and improve pricing heading into 2020, due to a rise in small trucker bankruptcies and failures so far in 2019.

And the better buy is...

All in all, it's a tough environment to figure out transport companies. The constant threat of trade wars and tariffs have shuffled customer demand, causing a spike around the beginning of 2019 as companies attempted to add inventory ahead of tariffs, and sluggish demand as the year has gone on due to uncertainty surrounding the on-again, off-again, trade battles.

A shortage in drivers brought about by low unemployment has also eaten into results, and persistent fears about the health of the U.S. economy has raised concerns about how much of the usual holiday surge will materialize this year and what 2020 demand will look like.

In this environment investors are wise to avoid trying to pick near-term winners and focus the company that is more likely to outperform over the long-haul. Werner is a solid and steady trucker, but my preference is to accept whatever added risk is still associated with XPO as there's a chance of capturing a return to its industry-beating performance.

Even without the rollup machine running, XPO shows the potential for solid growth in its e-commerce and digital offerings. The suggestion that Jacobs could soon return to dealmaking makes buying into XPO right now even more enticing. XPO is the better choice to outperform the market over time.