code: def read_xml_array(elts, variable_name):
          
          y = []
          x = []
          data = []
          for elt in elts:
              newx = elt.find('pixel').text.split()
              y += [int(elt.find('line').text)] * len(newx)
              x += [int(val) for val in newx]
              data += [float(val)
                       for val in elt.find(variable_name).text.split()]
  
          return np.asarray(data), (x, y)
docs: Read an array from an xml elements *elts*.