provide implementation for `xml_encode()`