I have to create an xml file which has encoding as
<?xml version="1.0" encoding="ISO-8859-1"?>
Currently the xml I am creating using LINQ is having tag as
<?xml version="1.0" encoding="UTF-8"?>
how can I do this using LINQ only.
You should use XDeclaration
:
var d = new XDocument(new XDeclaration("1.0", "ISO-8859-1", ""), new XElement("Root",
new XElement("Child1", "data1"),
new XElement("Child2", "data2")
));