(: Add genre to A.C.'s books :) for $book in db:open("books")//book return if ($book/author/text() = "A.C. Doyle") then insert node Kriminalliteratur into $book, db:optimize("books"), (: change value of names :) for $book in db:open("books")//book let $author := $book/author return if ($author/text() = "A.C. Doyle") then replace value of node $author with "Arthur Conan Doyle" else if ($author/text() = "E.A. Poe") then replace value of node $author with "Edgar Allan Poe" else (), db:optimize("books")