@Birgitta
Nun, vielleicht weil er geschrieben hat, dass er beides braucht?
Und ich ihm bereits gesagt habe, dass er dann beides per SQL machen soll?

@MSOST

D myfile SQLTYPE(CLOB_FILE) CCSID(1208)
myfile_name = '/Pfad/Name.xml'; // StreamFile
myfile_nl = %len(%trim(myfile_name)); // NameLength
myfile_fo = SQFOVR; // FileOverwrite

SELECT
into : myfile
XMLSERIALIZE(
XMLROW(...) as CLOB(2G) )
as XMLDOCUMENT

FROM...

Ich finde das schon einfach genug.