public static function buildAttributes($attributes)
    {
        $options = array();
        foreach ($attributes as $attr => $val) {
            $options[] = "{$attr}=\"{$val}\"";
        }
        return implode(' ', $options);
    }