1) Fixed issues in the code: uuid is not a string, attachment file name ...

...in XML and so on

2) Added respective tests