Generation of energy-entangled W states