use attibute to set length of XItem instead of using constructor