public void parse() throws XMLStreamException, InterruptedException {

		XMLInputFactory xif = XMLInputFactory.newFactory();
		XMLEventReader xmlreader = null;

		try {

			xmlreader = xif.createXMLEventReader(stream);
			while (xmlreader.hasNext()) {
				XMLEvent event = xmlreader.peek();
				if (event.isStartElement()
						&& event.asStartElement().getName().getLocalPart()
								.equals("payment")) {
					Payment payment = getPayment(xmlreader);
					paymentStorage.put(payment);
					
					/*
					 * logger.debug(payment.getPayer().toString());
					 * logger.debug(payment.getRecipient().toString());
					 * logger.debug(payment.getDetails().toString());
					 */
				} else {
					xmlreader.nextEvent();
				}
			}
		}

		finally {
			if (xmlreader != null) {
				xmlreader.close();
			}
		}

	}