Hi,
Use the following script code to submit the attachment to the document library.
attachmentNode = thisXDocument.DOM.selectSingleNode("xpath of the attachment control").text;
var data = DecodeAttachment(attachmentNode.text); //decode the attachment text and send that in to data variable.
try
{
// create a xmlhttp object
var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
var url = "url of document library";
//put the document/attachment on SharePoint
oXmlHttp.Open("PUT", url, false);
oXmlHttp.Send(data);
}