Skip to content

Instantly share code, notes, and snippets.

@andershaig
Created February 28, 2012 01:50
Show Gist options
  • Save andershaig/1928467 to your computer and use it in GitHub Desktop.
Save andershaig/1928467 to your computer and use it in GitHub Desktop.
XML Generator
function xmlgen(name, data) {
var xml;
if (!data) {
xml = '<' + name + '/>';
} else {
xml = '<'+ name + '>' + data + '</' + name + '>';
}
return xml;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment