Add unit test
Handle converting `@doc` into a string ourselves

Use `to_html` on every node, UNLESS it has a ‘selected’ attribute. In
that case, use `to_xhtml`.
Add comment
Merge branch 'fix-selected-attributes'