public function marshalToStream($mappedObject, $streamUri)
{
$writer = new WriterHelper($this, $streamUri);
// clear the internal visited list
$this->visited = array();
// Begin marshalling
$this->doMarshal($mappedObject, $writer);
return $writer->flush();
}