You're recreating context and unmarshaller during each loop iteration. You can probably move these variables outside of this loop.