/**
* @param string $streamUri
* @return object
*/
public function unmarshalFromStream($streamUri)
{
$reader = new XMLReader();
if (!$reader->open($streamUri)) {
throw MarshallerException::couldNotOpenStream($streamUri);
}
// Position at first detected element
while ($reader->read() && $reader->nodeType !== XMLReader::ELEMENT) {
}
$mappedObject = $this->doUnmarshal($reader);
$reader->close();
return $mappedObject;
}