Listing 30.10. Konwersja dokumentów XML do formatu TXT
$files = glob('dane-xml/*.xml');
foreach ($files as $f) {
    $nf = newfilename($f, '.txt');
    $parsed = parse_xml($f);
    $txt = array2txt($parsed);
    file_put_contents($nf, $txt);
}
