Maybe something like [untested]:
var reg = /(<span[^/>]+)\/>/gi;
var str = "<span id='d'/><div id='3'>d</div>" +
"<span id='j' style='blah: 10px'/>";
var a = str.replace(reg, "$1><\/span>");
alert(a);
But this would mean looking away from the actual problem; the problem here is that SPAN HTML tags need to have a ending tag. What is xmlParser here? How come xmlParser returns an invalid span tag; can't it be fixed to return proper spans?
And BTW, this isn't a Firefox problem, it is actually doing what it should do. Since SPAN tags need to have content, the /> is ignored and <span id="something" /> is treated as the start of a SPAN tag.
IMO, the solution you are seeking seems more like a hack.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De