title: How to collect attributes and values in function
body: <p>I am trying do this:
  I want to do function which receives
  one node as a parameter. and I it should return a string.
  so I need to loop node and I don't know more details,
  but I want to concatenate a new json type of string
  and returns it.
  but seems to be difficult, because I don't know xquery well.
  my idea is</p>
  <pre><code>declare function local:Do_the_thing($my_node as node()*) as xs:string{
  for ($element at $col in (attribute_list($my_node))
       let $complete_row_information := concat (&quot;test&quot;, &quot;test2&quot;);
  return $complete_row_information
  }
  </code></pre>
  <p>can someone say me, what is going wrong and how to fix it?
  if this thing is not in a function it works</p>