Adaptado do link
$doc1 = new DOMDocument();
$doc1->load('xml1.xml');
$doc2 = new DOMDocument();
$doc2->load('xml2.xml');
// get 'app' element of document 1
$app1 = $doc1->getElementsByTagName('app')->item(0);
// iterate over 'bbb' elements of document 2
$items2 = $doc2->getElementsByTagName('bbb');
for ($i = 0; $i < $items2->length; $i ++) {
$item2 = $items2->item($i);
// import/copy item from document 2 to document 1
$item1 = $doc1->importNode($item2, true);
// append imported item to document 1 'app' element
$app1 ->appendChild($item1);
}
$doc1->save('merged.xml');