I have to find all the voltages and current in the circuit
X=XL+XC=9Ω


This isn't correct. 

It's a bit confusing how reactance is defined, but inductive reactance and capacitive reactance have opposite signs when you combine them to determine the overall impedance, so you should have

$$ X=X_L - X_C $$

and you'll need to remember this is inductive reactance, so that you can combine it with the resistance to get the total impedance

$$ Z = R + jX$$

Where if the reactance was capacitive we'd use

$$ Z = R- jX_C.$$

Because of this confusion, I normally don't even work with reactance on its own, I just keep track of impedance

$$Z_L = j\omega L$$

and

$$ Z_C = \frac{1}{j\omega C}$$

When you combine impedances in series or parallel, you don't have to keep track of "off the books" signs.


  Ztotal=sqrt(R^2+X^2)


This isn't the total impedance (\$Z_{total}\$), it's the magnitude of the total impedance, \$\left|Z_{total}\right|\$.