Chunk看不到论点

I have this snippet (I want to get elements from .xml file):

$movies = simplexml_load_file('http://www.example.com/example.xml');
$out = "";

foreach ($movies as $movie) {
    $properties = array(
        'photo'   => $movie->image,
        'title'   => $movie->title,
        'desc'    => $movie->teaser,
        'channel' => $movie->channel,
        'date'    => $movie->date);

    $out .= $modx->getChunk('tpl_movies-item', $properties);
}

return $out;

And chunk tpl_movies-item:

<article>
    [[+photo]]
    [[+title]]
    [[+desc]]
    [[+date]]
    [[+channel]]
    aaa
</article>

It shows only "aaa" (but when I add "echo $properties['photo']" it prints right value), when I change values in array to strings, eg. 'desc' => "lololololol" it works right. Could u help me what should I do?

The problem is probably in your foreach statement since simplexml_load_file() needs ->children() to loop through the different childs of the object at hand. Try:

foreach ($movies->children() as $movie) {
    $properties = array(
        'photo'   => (string)$movie->image,
        'title'   => (string)$movie->title,
        'desc'    => (string)$movie->teaser,
        'channel' => (string)$movie->channel,
        'date'    => (string)$movie->date);

    $out .= $modx->getChunk('tpl_movies-item', $properties);
}

UPDATE

Try casting the properties as string as in the example above since they could be returned as objects.