public class save_base64stream{
public static void main(String[] args) throws Exception{
VTDGen vg = new VTDGen();
// AutoPilot ap = new AutoPilot();
// ap.selectXPath("/document/item/object/file/filedata/text()");
AutoPilot apAttr = new AutoPilot();
apAttr.selectXPath("/document/item/object/file");
if (vg.parseFile("./exported2.dxl",true)){
VTDNav vn = vg.getNav();
apAttr.bind(vn);
// ap.bind(vn);
int i,iAttr;
String fileName;
while ((iAttr = apAttr.evalXPath()) != -1){
iAttr=vn.getAttrVal("name");
fileName=vn.toString(iAttr);
System.out.println(fileName);
i=-1;
vn.toElement(VTDNav.FIRST_CHILD, "filedata");
i=vn.getText();
Base64.decodeToFile(vn.toString(i),"test-"+fileName);
vn.toElement(VTDNav.PARENT);