The value of X is calculated only once, as Shriekwood Devourer's last ability resolves. This means that the value of X may be different than you had hoped when attackers were declared if attacking creatures have left the battlefield or their power has changed.