implement xhtml option for self-closing elements. fixes #330.