Element Student= new Element("Student");
Student.setAttribute(new Attribute("NAME","Panther"));
依此类推

解决方案 »

  1.   

    可能是我理解错了,写标题
    Format fm = Format.getCompactFormat();
    fm.setEncoding("gb2312");
    fm.setIndent(" ");
    fm.setLineSeparator("\r\n");

    XMLOutputter outer=new XMLOutputter(fm);如果你能输出内容,这个代码应该能看懂,稍做改动 就可以了
    祝好运!
      

  2.   

    我已经这样写了Format fm = Format.getCompactFormat();
    fm.setEncoding("GB2312");
    ........
    ........可是就是那个样子,不能输出<?xml version="1.0" .....?>如果我不写 Format .........  XMLOutputter ....... 这些的话也不能输出到XML文档里吧,
    我现在已经写到XML文档里了,就是没有<?xml version="1.0" ...?>