给你段代码!自己研究下!别忘了给分哦
import org.jdom.CDATA;
import org.jdom.output.Format;
import org.jdom.Document;
import org.jdom.output.XMLOutputter;
import org.jdom.Element;
import java.net.URL;
import java.net.URLConnection;
import java.io.*;
import java.net.*;
import com.sitech.oneboss.security.SecurityTool;
import org.jdom.JDOMException;
import java.util.List;
import org.jdom.input.SAXBuilder;public class GreatXml {
    /**
     * 平台登陆报文
     * @return String
     */
    public String xml() {
        String xmldata = "";
        SecurityTool securityPortal = new SecurityTool();
        String pass = securityPortal.encryptPIN("ydzj01");
        Document doc = new Document();
        Element root = new Element("UIP");
        String bodyXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><OrgRegReq><OrgCode>14</OrgCode><UserName>ydzj01</UserName><PassWord>" +
                         pass + "</PassWord></OrgRegReq>";
        doc.setRootElement(root);
        Element em = new Element("OrigDomain").addContent("YDZJ");
        Element em1 = new Element("HomeDomain").addContent("BOSS");
        Element em2 = new Element("BIPVer").addContent("0100");
        Element em3 = new Element("TransCode").addContent("T990C001");
        Element em4 = new Element("ActionCode").addContent("0");
        Element em5 = new Element("TransIDO").addContent("123456");
        Element em6 = new Element("ProcessTime").addContent(
                "20060721145004");
        Element em7 = new Element("TestFlag").addContent("0");
        Element em8 = new Element("VerifyCode").addContent("FFFFFFFF");
        Element em9 = new Element("SessionID").addContent(
                "ABCDEFGHIGKLMNJTCL");
        Element ema = new Element("SvcContVer").addContent("0100");
        root.addContent(em);
        root.addContent(em1);
        root.addContent(em2);
        root.addContent(em3);
        root.addContent(em4);
        root.addContent(em5);
        root.addContent(em6);
        root.addContent(em7);
        root.addContent(em8);
        root.addContent(em9);
        root.addContent(ema);
        CDATA cdata = new CDATA(bodyXml);
        Element els = new Element("SvcCont").addContent(cdata);
        root.addContent(els);
        XMLOutputter outp = new XMLOutputter(Format.getPrettyFormat());
        xmldata = outp.outputString(doc);
        return xmldata;    }    public String httpxml(String u) {
        String value = "";
        try {
            URL url = new URL(u);
            URLConnection uc = url.openConnection();
            GreatXml gx = new GreatXml();
            String aa = gx.xml();
            String xmldata = URLEncoder.encode(aa, "utf-8");
            uc.setDoOutput(true);
            uc.setDoInput(true);
            uc.setRequestProperty("Content-Type",
                                  "application/x-www-form-urlencoded");
            uc.setRequestProperty("Content-Length", "" + xmldata.length());
            OutputStream os = uc.getOutputStream();
            DataOutputStream dos = new DataOutputStream(os);
            dos.writeBytes("xmldata=" + xmldata + "");
            dos.flush();
            dos.close();
            InputStream is = uc.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            GreatXml rx = new GreatXml();
            value = rx.xml(br);
        } catch (IOException e) {
            System.out.print(e);
        }
        return value;
    }    public String xml(BufferedReader is) {
        SAXBuilder builder = new SAXBuilder();
        String xml = "";
        String a ="";
        Document read_doc = null;
        try {
            read_doc = builder.build(is);
        } catch (IOException ex) {
            System.out.print(ex);
        } catch (JDOMException ex) {
            System.out.print(ex);
        }
        Element stu = read_doc.getRootElement();
        xml = stu.getChildText("SvcCont");
         a = xml.trim();
        if (a.equals("")) {
            xml = "1";
            return xml;
        } else {
            Document doc1 = null;
            try {
                InputStream inpuStream = new ByteArrayInputStream(a.getBytes("utf-8"));
                doc1 = builder.build(inpuStream);
                Element stu1 = doc1.getRootElement();
                List list = stu1.getChildren();
                Element e = (Element) list.get(0); //sessionid
                xml = e.getText();
            } catch (IOException ex1) {
                System.out.print(ex1);
            } catch (JDOMException ex1) {
                System.out.print(ex1);
            }
            return xml;
        }    }}