Need help with xpath and arrays

hi there,
I am desperatly trying to convert html tree into an php array


<fieldset>
<legend>Model</legend>
   <dl>
       <dt>Series</dt>
       <dd>Vapor-Y</dd>
</fieldset>

I want to have an array of type


Array( [Legend] => Array( [Series]=>Vapor-Y) ); 

I’ve been pondering this for about a day now, so far i have this code:


for($i=1;$i<=count($fieldsets);$i++)
		{
			$XQ=$xpath->query("//div[@id='Specs']//fieldset[position()=".$i."]//legend | 
								//div[@id='Specs']//fieldset[position()=".$i."]//dt | 
								//div[@id='Specs']//fieldset[position()=".$i."]//dd");
				foreach($XQ as $x)
					{
							if($x->nodeName=='legend')
								{
									$legend[]=$x->nodeValue;
								}
							
							if($x->nodeName=='dt')
								{
									$dt[]=$x->nodeValue;
								}
							if($x->nodeName=='dd')
								{
									$dd[]=$x->nodeValue;
								}
					
					}
					
					$defs=array_combine($dt,$dd);
					for($j=0;$j<count($legend);$j++)
						{
							$data[$legend[$j]]=$defs;
						}
				
		}
		print_r($data);

And the array that comes out from it is looking like this
print_r($data)
As you can see there are 9 arrays(‘the number of fieldsets’) filled with the same data . How do i avoid this ?