I have a xml and I want to add
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../test/Schemas/test.xsd"
to xml root element programmatically in c# so that the xml looks like below.
<?xml version="1.0" encoding="utf-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../test/Schemas/test.xsd" >
<value></value>
.
.
<root>
what I tried
doc.DocumentElement.SetAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"); doc.DocumentElement.SetAttribute("xsi:noNamespaceSchemaLocation="../../../../test/Schemas/test.xsd");