samsons17 -4 Posting Whiz in Training

I have this XML data which basically to add/minus/multiply the two numbers. And I have this Xquery function that suppose to convert this XML data into a readable string format.

For example, let say XML file has in this form :


the Xquery function will be able to convert this into "2 + 3" and 7 / (1 * 6) respectively through the local:convertExpr function

Below is the sample of the Xquery that I am working right now :

Xquery File :

declare function local:convertExpr($expr) {
    (: function to convert XML into a readable string format :)

    let $number := data($expr[1])

    let $x := $number
    return $x

        <script type="text/javascript" src="miniformvalidator.js"/>
                let $exprs := /*/q:expr, 
                    $count := count($exprs)
                 for $i in (1 to $count)
                 let $expr := $exprs[$i]
                 return <li>{local:convertExpr($expr)}</li>


I am able to pull all the numbers within the tags right now, but I am not sure how I can connect these numbers to become one readable string.

Please help. Thanks! :)