In 11g you can specify to pretty print XML when serializing using the indent clause of XMLSerialize. The trouble is this is formatted using the UNIX end of line marker, Line Feed = #10, even if Oracle is running under Window Server (windows uses Carriage Return + Line Feed = #13#10). This is causing problems when XML docs are delivered to users on Windows machines, who open it in notepad or similar - it means the data isn't visualised properly (not pretty printed) and they see the LF as a "box" character, which confuses them.
declare
vFileContents CLOB;
vXMLData XMLType;
begin
...
select XMLSerialize(document vXMLData as CLOB indent)
into vFileContents
from dual;
...
-- Code to output vFileContents to file.
end;
/
Is there any setting (session or DB) to specify CRLF as the default end of line marker, rather than having to do a search and replace on every document?