var x = XElement.Parse(@"<?xml version=""1.0"" standalone=""yes""?><connectionString><conn>adsf</conn></connectionString>"); // or var x = XElement.Load(@"c: empmy.xml"); var s = x.Element("conn").Value;