var key = keys[i], value = obj[key], isArray = Array.isArray(value);
if (typeof(obj[key]) == 'string' || isArray) {
var it = isArray ? value : [value];
it.forEach(function(subVal) {
if (typeof(subVal) != 'object') {
if (key == '$t') {
xml += subVal;
} else {
xml = xml.replace(/>$/, '');
xml += ' ' + key + '="' + subVal + '">';
}
}
})