JSFiddle - React, Tailwind, and code Playground

JavaScript

var xml='<search-result><onward-solutions><solution index="1"></solution><solution index="2"></solution><solution index="3"></solution></onward-solutions><return-solutions><solution index="1"></solution><solution index="2"></solution><solution index="3"></solution></return-solutions></search-result>';

var $xml = $(xml);

$xml.children('onward-solutions').remove();

xml = $xml.wrap('<x></x>').parent().html();

alert('xml=' + xml);