I was poking around with to_xml today, and I was semi-surprised to see
the "not all elements respond to to_xml" message... I had an array of
My first suggestion is that String would just replace the basic entity
chars that XML defines, much like ERB::Util#html_escape:
& ==> &
< ==> <
" ==> "
' ==> '
#html_escape would cover this except for the ' case, which
appears to be needed as well.
Any opinions? Patch + tests would be pretty easy to supply