I have some well-formed XML code, example below ...

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<sensors>
	<sensor>
		<group>Current Sensors</group>
		<series>CSN</series>
		<subcat>Closed Loop</subcat>
		<listing>CSNA111</listing>
		<title>50 A nominal, 70 A range, 1000 turns</title>
		<desc>The CSN Series of closed loop current sensors are based on the principles of the Magnetoresistive or Hall effects, and the null balance or zero magnetic flux method (feedback system). The magnetic flux in the sensor core is constantly controlled at zero. The amount of current required to balance zero flux is the measure of the primary current flowing through the conductor, multiplied by the ratio of the primary to secondary windings. This closed loop current is the output from the device and presents an image of the primary current reduced by the number of secondary turns at any time. This current can be expressed as a voltage by passing it through a resistor.</desc>
		<features>
			<fitem>Measures ac, dc and impulse currents</fitem>
		</features>
		<apps>
			<appitem>Variable speed drives</appitem>
		</apps>
	</sensor>
</sensors>
I have an HTML page with JavaScript code that reads this XML file and is supposed to display the data ...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>XML tester</title>

<script type="text/javascript">

var msie = (window.ActiveXObject) ? true : false;

var moz = (document.implementation && document.implementation.createDocument) ? true : false;

function importXML( xmlFile )
{
	if (moz)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = showGroups;
	}
	else if (msie)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) showGroups();
		};
 	}
	else
	{
		alert('Your browser can\'t handle this script');
		return;
	}
	if ( !xmlDoc.load(xmlFile) ) {
		alert ("Failed to load XML data source!");
	};
}

function showGroups ()
{
	// This function creates a linked list of product groups
	var x = xmlDoc.getElementsByTagName('sensor');
	var arrGroups = new Array ();
	var ctr = 0;
	for (i=0;i<x.length;i++)
	{
		var theNode = x[i].childNodes[0];
		if (theNode.nodeType != 1) continue;
		var theGroup = theNode.firstChild.nodeValue;
		var groupExists = false;
		for (j=0;j<arrGroups.length;j++)
		{
			if (theGroup == arrGroups[j])
			{
				groupExists = true;
			}
		}
		if (!groupExists)
		{
			arrGroups[ctr] = theGroup;
			ctr++;
		}
	}

	// Show the groups
	var newUL = document.createElement('UL');
	for (i=0;i<arrGroups.length;i++)
	{
		var newLI = document.createElement('LI');
		var newA = document.createElement('A');
		newA.setAttribute('href','#');
		newA.setAttribute('onClick','showListings ( "listings", ' + arrGroups[i] + ' )');
		var theData = document.createTextNode(arrGroups[i]);
		newA.appendChild(theData);
		newLI.appendChild(newA);
		newUL.appendChild(newLI);
	}
	document.getElementById('groups').appendChild(newUL);
}
</script>
</head>

<body onload="importXML( 'sensors.xml' )">

<div id="groups"><h3>Product Groups</h3></div>

</body>
</html>
This works fine in IE6. However Firefox1.5 shows nothing (there should be a rendered list under the Product Groups H3 tag) - all it shows (when I view generated source) is one set of <ul></ul> tags but no <li></li> etc tags.

Anyone got any clues/pointers as to why this is?