String xml = null;
boolean parsingerror = false;
try {
db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
PDXFA xfa = af.getXFA();
if (xfa == null)
return;
xml = DocumentAdapter.xmlFromXFA(xfa);
is.setCharacterStream(new StringReader(xml));
doc = db.parse(is);