给你一段用DOM实现的方法,JDOM我没用过,相信应该差不多吧
  /**
   * Explore xml tree
   * @param childNode
   */
  public static void ExploreTree( Node childNode )
  {
        String strNodeTxt = "";
        NodeList childNodeList = null;
        String strAttr = "";
        switch ( childNode.getNodeType() )
        {
            case  Node.ELEMENT_NODE:
            {
                 int nAttrCount = 0;
                 System.out.println( childNode.getNodeName() + ": " );                 while ( childNode.getAttributes().item( nAttrCount ) != null )
                 {
                     strAttr = childNode.getAttributes().item( nAttrCount ).getNodeValue();
                     System.out.print( childNode.getAttributes().item( nAttrCount ).getNodeName() + ": " );
                     System.out.println( strAttr );
                     nAttrCount ++;
                 }                 childNodeList = childNode.getChildNodes();
                 for( int i = 0;i < childNodeList.getLength(); i++ )
                 {
                     childNode = childNodeList.item( i );
                     ExploreTree( childNode );
                 }
                 break;
            }
            case Node.TEXT_NODE:
            {
                 strNodeTxt = childNode.getNodeValue();
                 if( !strNodeTxt.trim().equals( "" ) )
                 {
                     System.out.println( "节点内容:" + strNodeTxt );
                 }
                 break;
            }
            case Node.DOCUMENT_NODE:
            {
                 break;
            }
            case Node.DOCUMENT_TYPE_NODE:
            {
                 break;
            }            default :
            {
                 break;
            }         } // end switch
  }