Resolved issue with rendering XML attributes (keys were not properly removed during encoding)