Ritu,
Addition to the above Bhavin's code once the input filed is decrypted to make this as soap attachment use below code :
GlobalContainer globalContainer = container.getGlobalContainer();
byte[]convertedInput=decodedConten.getBytes();
OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
Attachment outputAttachment;
String contentType="application/xml"; ( " this depends on your content type i.e file type for ex: if you want it as a xml attachment then application/xml , for plain text it is text/plain)
outputAttachment = outputAttachments.create("Myfile.xml",contentType,convertedInput);
outputAttachments.setAttachment(outputAttachment);
Br,
Manoj