end
log 0, 'remove title from dedication'
-xml.css('dedication title')[0].content = ""
+if ! xml.css('dedication title').empty?
+ xml.css('dedication title')[0].content = ""
+end
log 0, 'move legal notice to bookinfo'
xml.css('book bookinfo')[0].last_element_child.after('<legalnotice>')