Invoices invs = txpy.invoices(oSes);
Document oDepo = oDms.getDocument(String.valueOf(lDepositId));
for (Document oDdoc : oDepo.children()) {
Log.out.debug("getting sides for document "+oDdoc.id());
NodeList<Document> oChlds = oDdoc.children();
Invoice[] aInvs = invs.create(oSes, sUid, sFlavor, sTaxPayerId, sBiller, sRecipient, oChlds.size());
int i = 0;
for (Document oSide : oChlds) {
Invoice oInvc = aInvs[i++];
oStm.setLong(1, Long.parseLong(oInvc.id()));
oStm.setLong(2, Long.parseLong(oSide.id()));