public Stock query(String identifier) {
        Element e = getStockByIdentifier(identifier);
        if (e == null) {
            return null;
        }
        return new Stock(identifier, e.getAttribute("name"),
                Integer.parseInt(e.getAttribute("inventory")),
                Float.parseFloat(e.getAttribute("price")));
    }