This paper develops a Heckscher−Ohlin model in which the effects on production structure of endowments and changes in trade policies depend in a continuous way on a country's degree of openness to trade. Its main contribution is to show semi-formally how the introduction of product differentiation causes the elasticities of output with respect both to factor endowments and to sectoral trade barriers to vary with import penetration (the share of foreign firms in home markets) and export orientation (the share of foreign markets in home-firm sales).