Hi Ricardo
The code that I provided above was for the custom adapter module GetMultiAnexoXml2 that was shown in your module screenshot. It's just to change the content type for attachments to application/xml as you requested for, and it's not applicable for Java mapping.
Not sure what is your design - what is being done in module and what is being done in Java mapping.
Anyway, had a look at your code and here are some of my comments:-
i) itAtt not defined anywhere
ii) attachId is initialized to blank and not updated, so the condition attachId.length > 0 will never be true.
Rgds
Eng Swee