i have some problems with xquery and external variable...this is my source code: first file xq \[code\]declare variable $id as xs:string external; declare function local:retrivalInfo() as element()* { let $linee := doc("fermate.xml")/corse/corsa return( for $linea in $linee return( <tr> <td>{$id}</td> <td>{data($linea/@partenza)}</td> <td>{data($linea/@parte_da)}</td> <td>{data($linea/@cadenza)} minuti</td> </tr> ) ) };\[/code\]now i would like to set the variable $id by this function that is in another file .xq: second file xq \[code\]declare function local:retrivalInfo() as element()* { let $linee := doc("fermate.xml")/corse/corsa return( for $linea in $linee return( <tr> <td>{data($linea/@linea)}</td> <td>{data($linea/@partenza)}</td> <td>{data($linea/@parte_da)}</td> <td>{data($linea/@cadenza)} minuti</td> AT THIS POINT SHOULD BE THE SETTING OF EXTERNAL VARIABLE <td><a href="http://stackoverflow.com/questions/14083055/fermate_capolinea.xq?id={data($linea/@linea)}">Fermate</a></td> </tr> ) )};\[/code\]togheter files .xq must generate xhtml code.thanks a lot!