<?php
declare(strict_types=0);
// session_start();

foreach($_GET as $campo => $valor){${$campo}=trim($valor);} 
foreach($_POST as $campo => $valor){${$campo}=trim($valor);} 

include_once('lib_main.php');
if(!empty($empr)){$link_data=msql_connect('','','',$empr); $cfg_empr=$empr;}

$user_codigo=$_SESSION['user_codigo'];
$user0=data_maes('user',$user_codigo);

$maes_codigo=data_maes($tabla,$codigo,$link_data);

$domd=new DomDocument();
     $domd->encoding = 'utf-8';
     $domd->xmlVersion = '1.0';
     $domd->formatOutput = true;
$elem=$domd;

$maes=$elem->appendChild($domd->createElement("div"));   

foreach($maes_codigo as $campo => $valor)
{
  $valor=trim($valor);
  if(!empty($valor))
  {$field=$maes->appendChild($domd->createElement($campo,$valor));}
}
echo $domd->saveXML();

?>
