public boolean decode(String data)
    {
		Document document = null;
		try
		{
			document = documentBuilder.parse(data);
		}
		catch (SAXException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		if (document == null)
			return false;

		NodeList nodeList = document.getChildNodes();
		if (nodeList == null || nodeList.getLength() != 1)
			return false;
		
        Node node = nodeList.item(0);
        if (node instanceof Element)
        {
        	Element xmlRoot = (Element)node;
        	if ("root".equals(xmlRoot.getNodeName()) && xmlRoot.hasAttributes())
        	{
                this.xmlRoot = xmlRoot;
                this.document = document;
                this.isXmlFormat = true;
                
                return true;
        	}
        }
        return false;
    }