I have an xml like this :
<name>
<class>
</class>
</name>
then i want to add the tag like this
<tia:Demographic><Age/><DOB/></tia:Demographic>
in between
<class>
How can we do that .
i am using following code.
XDoc.LoadXml(@"<name><class></class></name>");
XmlDocumentFragment xfrag = XDoc.CreateDocumentFragment();
xfrag.InnerXml = @"<tia:Demographic><Age/><DOB/></tia:Demographic>";
XDoc.DocumentElement.FirstChild.AppendChild(xfrag);
XDoc.Save(@"D:\test.xml");
but it throws an error that tia: not a registered namespace