private Element getStockByIdentifier(String identifier) {
        NodeList nl = doc.getDocumentElement().getElementsByTagName("stock");
        for (int i = 0; i < nl.getLength(); i++) {
            Element e = (Element) nl.item(i);
            if (e.getAttribute("identifier").equals(identifier)) {
                return e;
            }
        }
        return null;
    }