Optimization of the specific query

Hi All,

We a query which exports all objects, associations and classification from CS. Is there any way to improve it’s performance? Currently for the amounts of data about 30000 objects the execution of this query takes about 23 minutes.

The query:

declare namespace tmo=“http://tmobile.de/metadata/1.0
declare namespace cs=“http://namespaces.CentraSite.com/Schema/jaxr

{
for $o in input()/tmo:*
return

{$o/cs:name/cs:localString/text()}
{ if($o/cs:description/cs:localString/text()!=’’) then
{$o/cs:description/cs:localString/text()}
else
}

{for $c in $o/cs:classifications/cs:classification
return
}


{for $a in $o/cs:associations/cs:association
return
}


{for $s in $o/tmo:*
return $s
}


}