Listing 1 

var nodes = _data.selectNodes("//x:band[@name='Detail'][@updateFlag='Modified']");
for (i=0; i < nodes.length; i++) blob = blob + nodes[i].xml;
var nodes = _data.selectNodes("//x:band[@name='Detail'][@updateFlag='NewModified']");
for (i=0; i < nodes.length; i++) blob = blob + nodes[i].xml;
var nodes = _data.selectNodes("//x:band[@name='Detail'][@updateFlag='Deleted']");
for (i=0; i < nodes.length; i++) blob = blob + nodes[i].xml;
blob = "<blob_changes>" + blob + "</blob_changes>";