I need to check if an element in XML file exists. After searching here, I have tried a code from one of very similiar questions I found here, so the code looks like this(it is looped using foreach so it checks every airport in group airports):\[code\]string icao = airport.Attributes.GetNamedItem("icao").Value; if(airports.SelectSingleNode("/vEsup/airports/airport/" + icao + "/departures")==null) { MessageBox.Show("I exist!"); }\[/code\]Please note that the message box is just for testing, I find it the easiest way to check if the code is working properly. However, I found out that whatever path I enter, it always shows the messagebox, regardless if it exist in the XML file or not.