// edit
tu były głupoty, że aż mi smutno się robi dlatego już ich nie ma
pewnie istotnym faktem będzie wspomnienie, że chce wygenerować drzewo na podstawie tego xml`a

coś nie tak kumam. Korzystam z xml reader`a i mam taki kodzik
$xml = new XMLReader;
$xml->open('xml.xml');
$doc = new DOMDocument;
// move to the first <product /> node
while ($xml->read() && $xml->name !== 'HASLO');
// now that we're at the right depth, hop to the next <product/> until the end of the tree
while ($xml->name === 'HASLO')
{
// either one should work
//$node = new SimpleXMLElement($xml->readOuterXML());
$node = simplexml_import_dom($doc->importNode($xml->expand(), true));
// now you can use $node without going insane about parsing
// print_r($node->HASLO);
//echo $xml->getAttribute($node->HASLO->POZIOM);
// go to next <product />
$xml->next('HASLO');
}
no i fajnie wyświetli całą strukturę ALE jak np. wypisać tylko 1 poziom (każdy węzel ma atrybut poziom). np. chce wyświetlić tylko z poziomu 1 wtedy musiałbym zrobić tak
if($node->HASLO->HASLO['poziom'] == 1)
no i jest manufaktura.
p.s. Powtarzanie się "HASLO" jest praiwdłowe. to jedyny znacznik w tym pliku xml. haslo zawiera haslo ktory zawiera kilka haslo