me amo !!, gracias por la ayuda amigos este es el codigo que necesitaba
Código PHP:
try {
$dom = new DOMDocument();
$dom->load('xml/custom.xml');
$node = $dom->createElement('video');
$node->setAttribute('title', 'documental2');
$node->setAttribute('link', 'documental2');
$node->setAttribute('thumb', 'documental2');
$short= $dom->createElement( "short" );
$short->appendChild(
$dom->createTextNode( 'texto')
);
$node->appendChild( $short );
$xpath = new DOMXPath($dom);
$first = $xpath->query('//video[1]')->item(0);
if(null === $first) {
$dom->documentElement->appendChild($node);
} else {
$first->parentNode->insertBefore($node, $first);
}
$dom->save('xml/custom.xml');
} catch(Exception $e) {
//handle exception
}