moved XML parsing to the inside of graph draw function