// JavaScript Document
// XML writer with attributes and smart attribute quote escaping 
function element(name,content,attributes){
    var att_str = ''
    if (attributes) { // tests false if this arg is missing!
        att_str = formatAttributes(attributes)
    }
    var xml
    if (!content){
        xml='<' + name + att_str + '/>'
    }
    else {
        xml='<' + name + att_str + '>' + content + '</'+name+'>'
    }
    return xml
}

function elementNL(name, content) {
    return element(name,content) + '\n'
}

