JS for parsing XML and retuning data