Podrías ir iterando el arreglo para que vaya creando la estructura con addChild de SimpleXML.
Edito: de esta forma lo puedes hacer
Código PHP:
Ver original<?php
'ServicioEntregaResult' => array( 'ApplicationState' => array( 'OperacionExitosa' => 1,
'Novedad' => '-'
),
'Dato' => 123456
)
);
function convertArr($arr){
$convert = '';
foreach($arr as $key => $val){
? '<' . $key . '>' . convertArr($val) . '</' . $key . '>' . PHP_EOL
: '<' . $key . '>' . $val . '</' . $key . '>' . PHP_EOL;
}
return $convert;
}
$xml = convertArr($array);
$fixXml = new SimpleXMLElement($xml);
echo $fixXml->asXML();