QuiP Functions with Update

Hello,

I work with QuiP for update XML documents and I’ve found out a problem: I make the following code:
----------------------------------
update
for $doc in document(“GXLReader.xml”)//package-decl
where $doc/@name = “venice”
replace $doc/@name
with attribute name {“teste”}
---------------------------------

It runs OK. However, if I transform this code in a function like this below, it don’t runs anyway.

-------------------------------------
define function MovingClassBetweenPackages(string $documento, string $package_original, string $package_final)
returns element
{
update
for $doc in document($documento)//package-decl
where $doc/@name = string($package_original)
replace $doc/@name with attribute name {“teste”}
}



{
{MovingClassBetweenPackages(“GXLReader.xml”, “venice”, “teste”)}
}

------------------------------------------------
I receive the following error message: "Error (4,1): closing parenthesis missing. Actual token found: update "
Could anyone help me?
I attached the file GXLReader.xml
Thanks in advance.

Paulo Henrique
GXLReader.xml (56.7 KB)