What is the more effective way to get array of data out of xml for d3 chart?
I suggest you use JSON when manipulating the data because it's easier and less code compared to the same XML counterpart code - and much easier.

I can think of two ways you can do this:


Convert your files to JSON, if you can.
If you can't convert to JSON files, stay with what you are doing, and read the XML but convert them to JS objects before handing them over to the chart. There are XML-to-JSON libraries out there which you can use.


A similar data structure in JSON would look like

{
  "testcase" : {
    "measurement" : [
      {
        "type" : "M8015",
        "interval" : 15
      },{
        "type" : "M8016",
        "interval" : 15
      },{
        "type" : "M8020",
        "interval" : 15
      }
    ]
  }
}


And it's a matter of plucking out the data:

var myData = data.testcase.measurement;