bugfix: $entry can be xs:string
small paranoid addition
fixed sorting of writings