Relation between Domestic saving domestic investment and net exports in the economy?

The national account:

Y = C + I + G + (X-M)

rearrange that equation

1) Y-C = I + G + (X - M)

We also know that the income (Y) of a country can be a measure of income, so:

Y = C + T + S

OR

2) Y - C = T + S

By substituting the equation 2 into equation 1, we get:

T + S = I + G + (X - M)

and rearrange this formula into:

(X - M) = T - G + (S - I)

so the higher the saving, the higher the net export, and vice versa.

(Taken from: Miles and Scott, 2002, "Macroeconomics: Understanding of Wealth of Nations", pp. 479-480)