<?php
session_start();
@include('../_cfg/config1.php');
include('lib_gene.php');

$link_data=sql_connect('',$cfg_empr.'full','',$cfg_empr);

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

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

$xml=new DomDocument("1.0","UTF-8");
$xml->formatOutput = true;
$maes=$xml->appendChild($xml->createElement("div"));   

while ($valor = current($maes_codigo))
{
    $field=$maes->appendChild($xml->createElement(key($maes_codigo),$valor));   
    next($maes_codigo);
}

echo $xml->saveXML();

// echo 'PROBANDO'.$tabla.$codigo;

?>
