I have a remote Web service that returns to my JavaScript Web app the variable "DATA" defined in XML format.
An example of the data returned by a request would be:
<DATA><ID>1</ID><NAME>JOHN SMITH</NAME></DATA>
In JavaScript, how can I access the values of its attributes, i.e. the "1" as the ID and "JOHN SMITH" as the NAME?
For simplification,
(...)
var DATA = <DATA><ID>1</ID><NAME>JOHN SMITH</NAME></DATA>;
var ID = ??; //HOW TO ACCESS THE VALUE OF ID IN DATA?
var NAME = ??; //HOW TO ACCESS THE VALUE OF NAME IN DATA?
(...)
Thank you!