function ensureUniqueCapabilities(capabilities) {
    var uniqueCapabilities = [];
    capabilities.getchildren()
    .forEach(function(el) {
        var name = el.attrib.Name;
        if (uniqueCapabilities.indexOf(name) !== -1) {
            capabilities.remove(el);
        } else {
            uniqueCapabilities.push(name);
        }
    });
}