黑马程序员
java的 private static void addSex() throws Exception{ DocumentBuilderFactory buiderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder buider = buiderFactory.newDocumentBuilder(); Document document = buider.parse("src/person.xml"); NodeList list = document.getElementsByTagName("p1"); Node p1 = list.item(0);