XSLT is a failure wrapped in pain. There’s no job for which XSLT is the right tool. If you think you found a job for which XSLT is a good tool, chances are the job itself is fucked up.
 
me@me:~/tst/loffice$ soffice --headless --convert-to fods fug.xls
convert /home/me/tst/loffice/fug.xls -> /home/me/tst/loffice/fug.fods using filter : OpenDocument Spreadsheet Flat XML
[ ]
 

Лжецу мы не верим даже тогда, когда он говорит правду.
 
The fucking stupidest shit fucking ever. Fuck this shit. Fuck whoever wrote this. Stupid fucking cunt.
# Lalala, no errors, and no result also, I'm the idiotto.
foreach($xml->shop->offers->offer as $index => $offer)
{
  $offer['price'] = empty($offer['mrc']) ? 0 : $offer['mrc'];
}
# cock-a-doodle-doo!
# Indirect modification of overloaded element has no effect because the stupid cunt can't into usable interfaces. Don't call it simple anymore, you stupid piece of shit, it's not simple. You'd better to not write it at all then I'd write it by myself to not to waste time on such a shit. Fuck you. 
foreach($xml->shop->offers->offer as $index => $offer)
{
  $xml->shop->offers->offer[$index]['price'] = empty($offer['mrc']) ? 0 : $offer['mrc'];
}
# No reason for that shit to work here but it does. 
# AT LAST
foreach($xml->shop->offers->offer as $index => $offer)
{
  $offer->price = empty($offer->mrc) ? 0 : $offer->mrc;
}
[ ]
 

С обеих сторон войсками командовали сиятельные особы, убивавшие друг друга безо всякой жалости.
 
богохульство какая мерзкая возмутительная гадость
 
cast_to_bool = (value) ->
  switch
    when value is 1, value is true
      return true
    when value is 0, value is false, value is undefined, value is null
      return false
    when typeof value is "number" && !isNaN(value)
      return value isnt 0
    when value.toBoolean?
      return value.toBoolean() is true
    when value.toString? && ["true","yes","on"].indexOf(value.toString().toLowerCase().trim()) != -1
      return true
    else
      value = parseFloat(value)
      return !isNaN(value) && value isnt 0
[ ]
 

Плохому царю бояре мешают
 

Войны нельзя избежать, ее можно лишь отсрочить — к выгоде вашего противника.
 

Людей следует либо ласкать, либо изничтожать, ибо за малое зло человек может отомстить, а за большое — не может; из чего следует, что наносимую человеку обиду надо рассчитать так, чтобы не бояться мести.