when parsing the XML and inserting into the DB you'll do the following code:
db.beginTransaction();
try {
// here you parse and insert onto the DB.
// if any exception is reached (the XML reader connection was dropped or whatever)
// it will catch the exception and end the transaction without making it successful
// and SQLite will rollback all the actions you've done here.
db.setTransactionSuccessful();
} catch(Exception e){
Log.e("MyTag", "Transaction fail. " +
e.getClass().getSimpleName() + " - " +
e.getMessage());
}finally {
db.endTransaction();
}