Yes, the approach works. All you need is a lemma:
Lemma. Let $G$ be a group, and let $x$ and $y$ be elements of $G$ such that $xy=yx$. If $\gcd(|x|,|y|) = 1$, then $|xy|=|x||y|$, where $|g|$ is the order of $g$.
Proof. Let $|x|=r$ and $|y|=s$. Note that if $x^a = y^b$ for some integers $a$ and $b$, then $x^a=y^b=1$: for the order of $x^a$ is $r/\gcd(r,a)$ and the order of $y^b$ is $s/\gcd(s,b)$. Sincee $x^a=y^b$, then $r/\gcd(r,a) = |x^a| = |y^b| = s/\gcd(s,a)$. Thus, the order of $x^a$ divides $s$ and divides $r$, hence divides $\gcd(r,s)=1$; so $x^a=1=y^b$, as claimed.
Now: $\begin{align*} (xy)^k = 1 &\Longleftrightarrow x^kyk=1\\ &\Longleftrightarrow x^k= y^{-k}\\ &\Longleftrightarrow x^k = y^k = 1\\ &\Longleftrightarrow r|k\text{ and }s|k\\ &\Longleftrightarrow \mathrm{lcm}(r,s)|k\\ &\Longleftrightarrow rs|k. \end{align*}$ Thus, $|xy|=rs$, as claimed. $\Box$
Now use induction to show that $|x_1\cdots x_n|=|x_1|\cdots|x_n|$, and get your conclusion.
By the way, there are some nice generalizations of the Lemma above. See for example this question and this one. On the other hand, if $x$ and $y$ don't commute, then the orders of $x$, $y$, and $xy$ may be completely independent: given any three positive integers $r,s,t\gt 1$, there is a finite group $G$ with elements $x$ and $y$ such that $|x|=r$, $|y|=s$, and $|xy|=t$. In fact, this came up recently in MathOverflow.