generic xlit function