Adding 'lang' attribute to language links in template.php
I found the solution:

function MYTHEME_links__locale_block(&amp;$vars) {

  foreach($vars['links'] as $language =&gt; $langInfo) {
    $name = $langInfo['language']-&gt;native;
    $lang = $langInfo['language']-&gt;language;
    $vars['links'][$language]['title'] = $name;
    $vars['links'][$language]['attributes']['xml:lang'] = $lang;
    $vars['links'][$language]['attributes']['lang'] = $lang;
    $vars['links'][$language]['html'] = TRUE;
  }
  $content = theme_links($vars);
 return $content;
}