If you want to do this completely generically, you need to write a recursive function. That’s beyond the subset Tamino currently offers. The function would look something like this:
define function show($e as element()) as xs:string {
string-join (
(name($e), “=”,
if ($e/)
then for $c in $e/ show($c)
else string($e)
), “”)
}
You would need some refinement on that to get all the spacing and indentation right.
XQuery isn’t really designed for presentation tasks such as this, it’s more of a job for XSLT really. Use XQuery to get the data you want from the XML database, use XSLT to format it for display.
Michael Kay
#webMethods#API-Management#Tamino