echo 'let $doc := collection("'"$doc"'") return count($doc'"$query"')' > count.xq
echo 'let $doc := collection("'"$doc"'") return $doc'"$query" > mat.xq
echo 'let $doc := collection("'"$doc"'") return count($doc'"$query"')' > count.xq
echo 'let $doc := collection("'"$doc"'") return $doc'"$query" > mat.xq