Issue 11005 - std.xml does not encode attributes

I had this lurking in my code base for some time as a patch for Visual D.

http://d.puremagic.com/issues/show_bug.cgi?id=11005