So I basically need to find
$$\max \ \left\{u(x) = \left(\frac{1}{n} \sum_{i=1}^{n} x_i^\rho\right)^{1/\rho}\right\}$$ subject to $p_1x_1 + p_2x_2 + \dots + p_nx_n = W$
Can I still use Lagrangian? And how should I consider boundary cases here when some of the $x$'s are zero? I want to find Marshallian and Hicksian demand functions.
It is a CES utility function, and you should be able to set up the first order conditions to obtain the Marshallian demand:
$$X_i({\bf p};W)=\frac{p_i^{1/(\rho-1)}}{\sum_{j=1}^n p_j^{\rho/(\rho-1)}}W$$
(you can check here if stuck). You can likewise obtain Hicksian demand by optimization. But since you have already obtained Marshallian demand, you could just use duality:
Indirect utiltiy: $$V({\bf p};W)=u(X({\bf p};W))=\frac{1}{n^{1/\rho}}\left(\sum_{j=1}^n p_j^{\rho/(\rho-1)}\right)^{1/\rho-1 }W$$
Expenditure function:
$$u=V({\bf p};e(p,u))\implies e({\bf p};u)={n^{1/\rho}}\left(\sum_{j=1}^n p_j^{\rho/(\rho-1)}\right)^{1-1/\rho }u$$
Hicksian demand:
$$X_i^h({\bf p}; u)=\partial_{p_i} e({\bf p};u)={n^{1/\rho}}\left(\sum_{j=1}^n p_j^{\rho/(\rho-1)}\right)^{-1/\rho }p_i^{1/(\rho-1)}u.$$