 <p>XSLT doesn't operate on a sequence of characters, but on the tree defined by the XPath data model. There are some properties of the input that the XSLT processor cannot preserve, because it does not see them in the first place. This includes the amount of whitespace between attribute-value specifications in start-tags, the difference between literal characters and numeric character references, and the line-boundary sequences (CRLF, LF, or CR) in the input.</p> <p>If the reason you want to change as little as possible is that you have downstream processes which only kind of, sort of, understand XML, then some XML users will tell you that what you should do is get rid of that broken software and use XML-aware software instead.</p> <p>If the reason you want to change it as little as possible is that it's beautifully formatted and you don't want it mucked up, you may be able to reproduce your beautiful formatting with XSLT. Or not.</p> <p>If you really really need to preserve the distinction between Unix LF sequences and Windows CRLF sequences, you may want to consider some tool that takes a lower-level view of things. Perhaps you can write your transformation in sed. Perhaps you can write a simple transformation in sed that will turn the data into a form that you can read, modify, and rewrite with XSLT without information loss (and then another sed transform to read the XSLT output and put it back into the Win/Unix mix format). Some people would prefer to use Perl instead of sed. Some would do it all in Elisp.</p>