using System.Windows.Forms; using System.Xml; namespace xmlpath { public partial class Form1 : Form { XmlDocument dom = new XmlDocument(); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { dom.Load("h:\\cenik.xml"); string vyh = "/cenik/dodavatel/adresa/firma[text()='Comp s.r.o.']"; XmlNode uz = dom.SelectSingleNode(vyh); if (uz == null) MessageBox.Show("Nenalezen"); else MessageBox.Show(uz.InnerText.ToString()); } } }