code: public static byte [] readFile(SOAPMessage msg, Element el){
          Element include = XMLFormat.getFirstChildElement(el,"Include","http://www.w3.org/2004/08/xop/include");
          byte [] data  = null;
          if(include!=null){
              //LOG.debug("Reading XOP file")
              String id = "<"+include.getAttribute("href").substring("cid:".length())+">";
              Iterator<AttachmentPart> it = msg.getAttachments();
              while(it.hasNext()){
                  AttachmentPart att = it.next();
                  if(id.equals(att.getContentId())){
                      try {
                          data = att.getRawContentBytes();
                      } catch (SOAPException e) {
                          throw S1SystemError.wrap(e);
                      }
                      break;
                  }
              }
          }else{
              String b = el.getTextContent();
              try{
                  data = Base64.decode(b);
              } catch (Base64FormatException e) {
                  throw S1SystemError.wrap(e);
              }
          }
          if(LOG.isDebugEnabled())
              LOG.debug("Reading file from SOAP, length: "+(data==null?-1:data.length));
          return data;
      }
docs: Read binary data from element (base64 or xop:Include)
  
  @param msg
  @param el
  @return