import org.jdom.output.*;
import org.jdom.input.*;
import java.io.*;
public class TestJDOM{
public static void main(String args[])throws Exception{
SAXBuilder sb = new SAXBuilder();
//从文件构造一个Document,因为XML文件中已经指定了编码,所以这里不必了
Document doc = sb.build(new FileInputStream("exampleA.xml"));
//加入一条处理指令
ProcessingInstruction pi = new ProcessingInstruction
文章来源于领测软件测试网 https://www.ltesting.net/