esharris has asked for the wisdom of the Perl Monks concerning the following question:

I need a subroutine that takes an arbitrary string and returns that string in XML format. For example, it should change "IBM & Microsoft" into "IBM & Microsoft". The hypothetical subroutine would be simiar to CGI::escape, which returns a given string in HTML format. Does such a subroutine exist under CPAN? Though I looked around CPAN and used Google, I am having difficulty finding it. I figure there is no sense re-inventing the wheel.

Edited by Chady -- fixed &