input xml $80.;
<?xml version="1.0" encoding="UTF-8"?>
set have end=last;
length url $1000;
If you really need the double linefeed characters (hex 0A) representing the line breaks, insert
if not last then url=catt(url,'%0A%0A');
before the subsetting IF statement if last.
Your sample output also shows some blanks (hex 20) after line 2 and 3. To reproduce this in this particular example, you could insert a second IF statement: