<PackageReference Include="System.Xml.ReaderWriter" Version="4.0.11-beta-23409" />

NewLineHandling

public enum NewLineHandling
Specifies how to handle line breaks.

New line characters are entitized. This setting preserves all characters when the output is read by a normalizing XmlReader.

None = 2

The new line characters are unchanged. The output is the same as the input.

Replace = 0

New line characters are replaced to match the character specified in the NewLineChars property.