Hi Michal,
Sorry I think I read the original question to quickly
Anyway what you are asking should still be possible. I now created a little example which should help you. I have inserted the following three documents into Tamino:
<a>
<b id="x">document 1.0</b>
</a>
<a>
<b id="y">document 2.0</b>
</a>
<a>
<b id="a">document 3.0</b>
<b id="b">document 3.1</b>
<b id="c">document 3.2</b>
</a>
</pre><BR><BR>Now using XQuery I want to produce a <result> element followed by some elements with the values of the id attributes (but NOT as attributes but as text) and then the child elements of <a>. So for the third example I will get something like:-<BR><BR><pre class="ip-ubbcode-code-pre">
<result>
<startlist>
<someattr>a</someattr>
<someattr>b</someattr>
<someattr>c</someattr>
</startlist>
<b id="a">document 3.0</b>
<b id="b">document 3.1</b>
<b id="c">document 3.2</b>
</result>
</pre><BR><BR>The XQuery I wrote is:-<BR><pre class="ip-ubbcode-code-pre">
for $x in input()/a
let $y := $x/*
let $u := for $uu in $y//@id
return <someattr>{string($uu)}</someattr>
return
<result><startlist>
{$u}
</startlist>
{$y}
</result>
I use the string() function otherwise the attribute and not the text representation is inserted into the result document.
I hope this is nearer to what you are looking for 
Stuart Fyffe-Collins
Software AG (UK) Ltd.
#Tamino#webMethods#API-Management