XLToList<IMyInterface> x; if(SomeCondition) x = new XLToList<AClass>(); else x = new XLToList<ADifferentClass>();