public static Message parse(String text) throws SAXException {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db;
        try {
            db = dbf.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new RuntimeException(e);
        }

        Document dom;
        try {
            dom = db.parse(new ByteArrayInputStream(text.getBytes("UTF-8")));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        Element messageElement = dom.getDocumentElement();

        NodeList receiversNodeList = messageElement.getElementsByTagName("receiver");
        NodeList parametersNodeList = messageElement.getElementsByTagName("parameter");

        List<String> receivers = Lists.newArrayList();
        Parameters parameters = new Parameters();

        if (receiversNodeList != null && receiversNodeList.getLength() > 0) {
            for (int i = 0; i < receiversNodeList.getLength(); i++) {
                receivers.add(receiversNodeList.item(i).getTextContent());
            }
        }

        if (parametersNodeList != null && parametersNodeList.getLength() > 0) {
            for (int i = 0; i < parametersNodeList.getLength(); i++) {
                Element element = (Element) parametersNodeList.item(i);
                parameters.put(element.getAttribute("name"),
                        unespace(element.getTextContent()));
            }
        }

        return new Message(messageElement.getAttribute("sender"),
                messageElement.getAttribute("action"),
                messageElement.getAttribute("authtoken"), receivers, parameters,
                new Date(Long.parseLong(messageElement.getAttribute("date"))));
    }