public static void recursionElement(Element element)
	{
		
		String elementname = element.getTagName();
		
         System.out.print("<" + elementname);
         
         NamedNodeMap nnm = element.getAttributes();
         
         if(null != nnm)
         {
        	 for(int i = 0 ; i < nnm.getLength(); i ++)
        	 {
        		 Attr attr = (Attr)nnm.item(i);
        		 
        		 String attrname = attr.getName();
        		 
        		 String attrvalue = attr.getValue();
        		 
        		 System.out.print(" " + attrname + "=\"" + attrvalue +"\"");
        	 }
         }
         
         System.out.print(">");
         
         NodeList nl = element.getChildNodes();
         
         for(int i = 0 ; i < nl.getLength(); i ++)
         {
        	 short nodetype = nl.item(i).getNodeType();
        	 if(nodetype == Node.ELEMENT_NODE)
        	 {
        		 //递归入口
        		 recursionElement((Element)nl.item(i));
        	 }
        	 //递归退出口
        	 if(nodetype == Node.TEXT_NODE)
        	 {
        		 System.out.print(nl.item(i).getNodeValue());
        	 }
        	 if(nodetype == Node.COMMENT_NODE)
        	 {
        		 Comment comment = (Comment)nl.item(i);
        		 
        		 System.out.print("<!--" + comment.getData() + "-->");
        	 }
         }
         System.out.print("</" + elementname + ">");		
	}