Solved: Foreach-loop containes the different nodes I need to change innertext from. In each " var XXXNode = node.SelectSingleNode("x:XXX", nsmgr); " You need to add "//" before the "x". Like this
var identificationNode = node.SelectSingleNode("//x:Identification", nsmgr);
if (identificationNode != null)
{
identificationNode.InnerText = "string";
}
var SCI = node.SelectSingleNode("//x:SCI", nsmgr);
if (SCI != null)
{
SCI.InnerText = "56987465";
}
var ReferenceType = node.SelectSingleNode("//x:ReferenceType", nsmgr);
if (ReferenceType != null)
{
ReferenceType.InnerText = "AA";
}
var CCType = node.SelectSingleNode("//x:CCType", nsmgr);
if (CCType != null)
{
CCType.InnerText = "string";
}
Also use the "root.OuterXml" to show the changes in the object of VS. Here:
richTextBox1.Text = root.OuterXml;