That is quite strange. Why don't you have a look at Section 3.3.3 of the XML Recommendation. It's headed "Attribute-Value Normalization" and it deals with what a parser is supposed to do to an attribute. I don't see it mentioning inserting characters anywhere, so what you describe looks wrong to me. It even refers to section 2.11, which talks about removing characters. And you certainly aren't inserting them in your transformation, not that I can see anyway.
(If you want the forum to not interpret your & characters, you have to escape them as & when you post.)