Let $X$ be a random variable with values in $\mathbb Z_{\geq0}$. Show that $E[X]=\sum_{k=0}^\infty P[X>k]$ 
Let $X$ be a random variable with values in $\mathbb Z_{\geq0}$. Show that $E[X]=\sum_{k=0}^\infty P[X>k]$.

The question is taken from Introduction to Probability Models, 10th Ed. (Ross, pg. 91).
Attempt. Let $X=\sum_{k=1}^\infty X_k$, with
\begin{equation}X_k=\begin{cases}1 & \text{when }X\leq k \\ 0 & \text{when }X>k\end{cases}\end{equation}
Since $E[X_k]=P[X\leq k]$,
$$E[X]=\sum_{k=1}^\infty E[X_k]=\sum_{k=1}^\infty P[X\leq k]=\sum_{k=1}^\infty \left(1-P[X>k]\right)$$
And at this point I'm at a loss as to how I should obtain the result.
Attempt 2. Following drhab's help, I reformulated the definition of $X$ in terms of $X_k$. Using the same $X_k$ (for brevity of this post), let $X=\sum_{k=0}^\infty(1-X_k)$. Then
$$E[X]=\sum_{k=0}^\infty E[1-X_k]=\sum_{k=0}^\infty(E[1]-E[X_k])=\sum_{k=0}^\infty(1-P[X\leq k])=\sum_{k=0}^\infty P[X>k]$$
I believe this is correct now.

Hint:
Do we really have $X=\sum_{k=1}^{\infty}X_k$?
If e.g. $X=3$ then $X_1=0=X_2$ and $X_k=1$ if $k\geq3$.
