The &foo; syntax has special meaning in XML. However, unlike HTML, XML does NOT predefine a bunch of named enties. So, if the entity has not been declared first, the XML parser won't know what it is. The only exceptions to these entities are > < & " ' and those in the form of 
 etc.
If you want to preserve the entity verbatim, you probably want to do this:
$xml =~ s/&(?!gt;|lt;|amp;|quot;|apos;|#x\d+;)/&/g;
Basically, you are properly escaping all of the & that should not be in the XML. So &simple; would become &simple; (boy this is hard to type in HTML).
Sorry, the code is untested, but should work ;-)
Update: Added the ; in the regex to make it a little more correct.
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)In reply to Re: Simply Choking
by TedYoung
in thread XML::Simple and problem characters
by Grundle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |