I definitely wouldn't suggest regular expressions as a general way of parsing arbitrary XML or HTML, but since you said this is so well-formed the usual warning can probably be ignored in this case:
sed -n '/^<url>$/{n;N;N;N;s/\n/ /g;s/ *<[a-z]*>//g;s/<\/[a-z]*>/ /g;p}'
Here is a commented version that explains what is going on:
sed -n '/^<url>$/ { # if this line contains only <url>
n;N;N;N # read the next 4 lines into the pattern space
s/\n//g # remove newlines
s/ *<[a-z]*>//g # remove opening tags and the spaces before them
s/<\/[a-z]*>/ /g # replace closing tags with a space
p # print the pattern space
}' test.txt
The -n
option suppresses the automatic printing of the pattern space.