not sure how to replace & and   for xml
I have a paragraph that needs to be converted into xml paragraph includes spaces ( ) and simple ampersand (&) and ofcourse <br> tags. Here is my regex
$str =~ s/br\>/br\/\>/g;
$str =~ s/nbsp/#160/g;
$str =~ s/&/&\;/g;
<br> tags are easily manipulated into <br/> but for   it puts &#160; I know that its basically first changing nbsp to #160; and than the next line goest and adds & to my ampersand. How do I approach this problem so for all & cases it puts & and for all   cases it puts Please help.
|