Of course it can be done! It might not be easy but if they could do it in 1853..
The hardest part is not to identify the elements but to determine the concentration of each element. Sulphur, for example, is usually found in concentrations around 0.02% wich might be a bit tricky to measure reliably
To start, one would need pure samples of all the metals that should be deteced to document the spectral lines without interference, or look it up in a book or on the web http://student.fizika.org/~nnctc/spectra.htm