This query returns a sequence of xs:integer or xs:double values depending on the value of the total element in the XML document:
SELECT CAST(XMLQUERY('for $cust in /customers/customer return sum(order/total)' passing xmldoc) AS VARCHAR(512)) AS ordertotals FROM xmltab;
The result of this query is the following string value of type VARCHAR (XQuery cast of each item to xs:string, separated by a single white space character):
2496.50 1383.50