It’s time to buy Exxon Mobil , as the stock’s pullback from a record high opens an attractive entry point for investors, Piper Sandler said. “We are upgrading XOM from Neutral to Overweight to reflect the significant transformation underway at the company, increasingly advantageous asset portfolio, attractive portfolio mix (overweight refining and strong exposure to international gas with bullish 18+ month outlooks for both), and attractive relative valuation (trades at a slight discount to CVX, while premium vs. Europeans has narrowed),” analyst Ryan Todd wrote in a note to clients Tuesday. Todd says a return to refining profitability could boost Exxon in the near term and anticipates record second-quarter results for U.S. refiners and a strong outlook for the current period. “While fears of upstream cost inflation may raise some concern, the full return of refining profitability (and then some) and an assurance not to repeat past mistakes with excess CFO is likely to make IOCs look increasingly mispriced,” he wrote. Shares of Exxon have been on a solid run this year, as the oil company benefits from tight supply and rising gas prices. The stock has risen nearly 41% and could rally another 26.5% based on the firm’s $109 price target. However, Exxon has fallen more than 18% since hitting an all-time high in June. Across the board, the energy sector is up more than 26% this year, although the group has pulled back from record highs. Todd also says that Exxon offers one of the most defensive portfolios within its peer group, and its exposure to international gas and liquified natural gas provides the “greatest leverage to markets with an ‘upside risk bias.'” “We view the current relative valuation as extremely attractive, with XOM trading at a slight discount vs. CVX, which together with the pullback in the stocks, provides an attractive entry point for investors looking to build a position in one of the leading global major,” Todd said. — CNBC’s Michael Bloom contributed reporting.