public void readFromXML(XMLStreamReader in)
        throws XMLStreamException {
        String senderString = in.getAttributeValue(null, "sender");
        sender = game.getFreeColGameObject(senderString, Player.class);

        String recipientString = in.getAttributeValue(null, "recipient");
        recipient = game.getFreeColGameObject(recipientString, Player.class);

        status = Enum.valueOf(TradeStatus.class,
                              in.getAttributeValue(null, "status"));

        items = new ArrayList<TradeItem>();
        TradeItem item;
        while (in.hasNext()) {
            if (in.next() != XMLStreamConstants.START_ELEMENT) continue;
            if (in.getLocalName().equals(StanceTradeItem.getXMLElementTagName())) {
                item = new StanceTradeItem(game, in);
            } else if (in.getLocalName().equals(GoodsTradeItem.getXMLElementTagName())) {
                item = new GoodsTradeItem(game, in);
            } else if (in.getLocalName().equals(GoldTradeItem.getXMLElementTagName())) {
                item = new GoldTradeItem(game, in);
            } else if (in.getLocalName().equals(ColonyTradeItem.getXMLElementTagName())) {
                item = new ColonyTradeItem(game, in);
            } else if (in.getLocalName().equals(UnitTradeItem.getXMLElementTagName())) {
                item = new UnitTradeItem(game, in);
            } else {
                logger.warning("Unknown TradeItem: " + in.getLocalName());
                continue;
            }
            items.add(item);
        }

    }