pylib: we need to escape % in XML attribute

apparently % is another reserved character in XML attributes and
needs to be escaped