Do I really need to do all this just to get one item per line $ basex -s format=no -q 'doc("...")//.../*:name/concat(text(),"
")'
By default, there won't be any delimiting character between text nodes, which is why it wouldn't help to replace spaces with newlines. However, you may want to use the -w flag to preserve the original document whitespaces and newlines.
Christian