Improved error handling signing XML documents.