You should use "\r\n" for representing new lines.
There are two ways you can handle the newlines:
Set-up the writer to use specific characters when writing new lines using the NewLineChars option.
Instruct the writer not to modify the new lines using the NewLineHandling option
So you could modify your code as follows to preserve the new lines:
var xslt = new XslCompiledTransform();
xslt.Load(HttpContext.Current.Server.MapPath("~/XML/CareLog.xsl"));
var settings = xslt.OutputSettings.Clone();
settings.NewLineChars = "\n";
settings.NewLineHandling = NewLineHandling.Replace;
using (var reader = XmlReader.Create("example.xml"))
{
using (var writer = XmlWriter.Create("yourDoc.txt", settings))
{
xslt.Transform(reader, writer);
}
}
Note that I haven't run this. The only thing you'll need to do is get your file into the call to "XmlWriter.Create()".