if (doEncode) {
EncodableData data = new EncodableData("content", null, Constants.TYPE_BLOB, Constants.ENCODING_BASE64);
data.setValue(content);
data.setSize(content.length);
to.write(data.toXml(" ").getBytes());
}
else {
EncodableData data = new EncodableData("content", null, null, null);
//String charSet = "UTF-8"; // "ISO-8859-1", "US-ASCII"
//data.setValue(new String(content, charSet), null);