Relocate `encodeXMLComponent` function.