Actually I had to change a small thing to make it work : to use the method "outputText()" instead of the attribute "output" (but this is maybe due to the fact I am using a version 4.1).
Hakim: what class is $output? ( call "var_dump($output);" for instance)
$ouput->attribute( 'output_text' ); should have worked, as it uses outputText() in eZXMLOutputHandler, but if you have another output handler for some reason, then it might not work.