selectnodes query is not working
XmlDocument doc = new XmlDocument();
doc.LoadXml(SqlScriptXml);
XmlNodeList nodeList;
if (doc.DocumentElement.Attributes["xmlns"] != null)
{
string xmlns = doc.DocumentElement.Attributes["xmlns"].Value;
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
nsmgr.AddNamespace("MsBuild", xmlns);
nodeList = doc.SelectNodes("/MsBuild:Project/MsBuild:ItemGroup/*", nsmgr);
}
else
{
nodeList = doc.SelectNodes("/Project/ItemGroup/*");
}
foreach (XmlNode node in nodeList)
{
string name = node.Name;
}