when you meant you got the information from xml file it contains x and y co-ordinates as well as child nodes. Then you have them as well for your calculation. Are you not sure of how to parse xml is...