XDocument xdoc = XDocument.Load(targetFileName); var attrib = xdoc.Root.Attribute("options").Value; // attrib = "idprefix:realID"