Check out the following example:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Xml;
using System.IO;
namespace WindowsFormsApplicationCS
{
public partial class Form8 : Form
{
public Form8()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
XmlNodeList xmlnode;
int i = 0;
List<string> listx = new List<string>();
FileStream fs = new FileStream("XMLFILE1.xml", FileMode.Open, FileAccess.Read);
xmldoc.Load(fs);
xmlnode = xmldoc.GetElementsByTagName("Point");
for (i = 0; i <= xmlnode.Count - 1; i++)
{
listx.Add(xmlnode[i].Attributes["x"].Value);
}
for (int k = 0; k < listx.Count; k++)
{
MessageBox.Show(listx[k]);
}
}
}
}
This solution will read the x values from the xml file and store them in a list called listx. I shall leave it to you to do the same for y and z.