encode instead of decode when writing attributes
Merge pull request #1558 from rainers/std_xml_attr_encode

 Issue 11005 - std.xml does not encode attributes