Update about signing arbitrary transactions.
My plan for the way to support arbitrary transactions turns out not to be possible. The Nano S only has 10Kb of RAM available in total. Not all of that is even available to the individual apps running on the device because part of it is used by the OS. So sending arbitrary size transactions to the device is impossible. A small test shows a transaction containing only 10 payment operations that include a memo is already more than 2Kb.
So after deliberating the options I've come up with a new plan to support arbitrary transactions. I will have two signing operations. One "super safe" signing operation that only takes a transaction that contains at most one simple payment operation. This method of signing a payment is able to show payment details on the device screen for confirmation. A second, less secure, signing operation that takes only the transaction hash (initially proposed by @dzham ). This second operation will show a warning on the device screen that no data is available.
It is up to the wallet to choose either one of the methods to sign transactions. A simple payment wallet can use the operation that displays the transaction details for the user to confirm. A more sophisticated wallet can use the operation that signs the hash alone but shows no transaction details on the device.
The advantage of this approach is that it remains possible to sign arbitrary transactions while xdr transaction parsing can stay very simple, only having to deal with a single payment operation. The alternative would have been more complicated (and thus error prone) xdr transaction parsing while still not being able to support arbitrary transactions.
Thoughts?