If query does not return any result than return value is empty array. The examples below shows how to query the domain database. The syntax of the query is quite detailed. More information can be found on xquery standard page. ,
$XmlRepository.Query('for $customer in //Customer[Id=$id] return replace value of node $customer/Name with "Lady Gaga"',{id:$Xml.Evaluate('CustomerId')});
$XmlRepository.Query('insert node (<Kaynak><Id>{$newId}</Id><Ad>{$newName}</Ad></Kaynak>) as last into /KVKEnvanter/Tanimlar/Kaynaklar',{newId:newId,newName:name.trim()});