I used this code to sort the problem it's not the best formed I don't think but it works.
Now I need to cure case sensitive issues
<?php
$xml = simplexml_load_file('edtest1.xml');
$page_numbers = array(
'SWOT' => 'Software',
'SWUT' => 'Software',
'VOGA' => 'VOIP',
);
// Loop through all items in XML
foreach( $xml->item as $item ) {
// Check if 'catcode' is a child of this item
// and if $page_numbers has a matching key
// In order to use the value as an array key, we need to explicitly
// call it as a string, using typecasting (string)
if( isset($item->catcode) && isset($page_numbers[(string)$item->catcode]) )
// Create a new child under this item, using the $page_numbers value
$item->addChild( 'catparent', $page_numbers[(string)$item->catcode] );
}
// Output the XML
echo $xml->saveXML(test.xml);
?>