// Add CR/LF to file.
var myFile = File.ReadAllText(_filePath);
myFile = myFile.Replace(">", ">" + Environment.NewLine);
File.WriteAllText(_filePath, myFile);
<name>nextOver.gif</name><relativelink>images/nextOver.gif</relativelink><resourceflags>0</resourceflags>...
string result = Regex.Replace(str, "</([^>]*)>", "</$1>" + Environment.NewLine);
using (XmlWriter writer = XmlWriter.Create(filename, new XmlWriterSettings
{ Indent = true, IndentChars = String.Empty }))
{
xmlDocument.Save(writer);
}
var myFile = File.ReadAllText(_filePath);
myFile = myFile.Replace(">", ">" + Environment.NewLine);
File.WriteAllText(_filePath, myFile);
<name>nextOver.gif</name><relativelink>images/nextOver.gif</relativelink><resourceflags>0</resourceflags>...
string result = Regex.Replace(str, "</([^>]*)>", "</$1>" + Environment.NewLine);
using (XmlWriter writer = XmlWriter.Create(filename, new XmlWriterSettings
{ Indent = true, IndentChars = String.Empty }))
{
xmlDocument.Save(writer);
}