The answer to your question is yes. Let $X$ be a smooth genus $g$ curve and let $L$ be a very large degree line bundle ($\deg L>2g+2n+2$ should do). Let $P_i, Q_i\in X, 1\leq i\leq n$ be $2n$ distinct points. Then you have a surjection $H^0(L)\to H^0(L_{|{\cup P_i\cup Q_i}})=\prod k(P_i)\times\prod k(Q_i)$. Take $\prod_{i=1}^n k\to \prod k(P_i)\prod k(Q_i)$ given by each $k$ mapping to $k(P_i)\times k(Q_i)$ as the diagonal embedding. Let $V\subset H^0(L)$ the sections mapping to this $\prod k\subset \prod k(P_i)\times \prod k(Q_i)$. Then, you can consider the the map given by this linear system $V$ and check that the image is precisely a curve where the $P_i,Q_i$ for all $i$ are identified into nodal points. The checking is tiresome, but follows the same principle as you would find in Hartshorne's book.