I have to get 5 accessories (images) from 5 latest posts from given category ('foobar') in Wordpress. Right now I'm able to get it done by calling two functions individually (Wordpress_Query and obtain_children):

$query = new WP_Query('category_name=foobar&post_status=publish&showposts=5');
foreach($query->posts as $spost)
{
    $children =& get_children('post_type=attachment&post_mime_type=image&post_parent='.$spost->ID);
    foreach($children as $child)
    {
        echo wp_get_attachment_thumb_url($child->ID);
        echo wp_get_attachment_url($child->ID);
        //etc...
    }
}

But I am searching for simpler solution (maybe with utilization of wpdb?) Can there be any?