Hello I was wondering if someone could help me with this awfully frustrating conundrum. What I am trying to do is have the return return both a single value and the results of another xquery. The tricky part is that I do not want to return the content as XML but rather in plain text.*

My specific case is that I want to find every enumeration in an XSD, print out the name of the datatype, and underneath it the list of all its possible values.


Now this works:
Code:
declare namespace xsd = "http://www.w3.org/2001/XMLSchema";
declare variable $url := ".....";
declare variable $src := doc($url);
declare variable $nl := codepoints-to-string(10);

for $type in $src//xsd:simpleType[.//xsd:enumeration]
	let $typeName := string($type/@name)
	return <x>{concat($nl,"===",$typeName,"===")}{
			for $value in $type/xsd:restriction/xsd:enumeration/@value
				let $enumName := string($value)
			return concat($nl,"* ",$enumName)			
			}</x>
But if I try to remove the <x></x> it fails. I've tried every possible combination of {} and , imaginable. I also tried passing the second XQuery as an argument to concat() but that didn't work either. While I could do some post processing but since I'd like to be able to rely on XQuery in the future I want how to learn to do this the proper way.

I tried Googling but all examples show only the XML version and I'm certain there must be a way to do this for plain text

* Technically I'm trying to output it in MediaWiki syntax.