cannot create a new element in newly created html5 document, issue reported by Sam MacPherson
escape special xml chars as entities when serialized, fixes #10