Does the XML file format even care, at all, about newlines?
It depends what you mean.
To XML, newlines and carriage returns do not have special meaning. Stripping them from the document will not affect the validity of the document.
On the other hand, it will change the values of text nodes and attribute nodes. (Upd: Not completely true: See Re^7 ) That may or may not be desirable. The OP indicated he only wanted to remove <CR><LF> pairs and leave lone <LF> behind, which can be done using your technique.
Update: Replaced bad example with better explanation.
In reply to Re^3: Scrubbing XML
by ikegami
in thread Scrubbing XML
by the.duck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |