Added helper for processing XML responses.
Added listInvoices.
Tidied and simplified.