jOOX 是 Java Object Oriented XML 的缩写(尽管我觉得这名字有点猥琐),是 org.w3c.dom 包的简单封装。用于 XML 文档的创建以及 DOM 的操作,其思路很像 jQuery。
示例代码:
// Find the order at index 4 and add an element "paid" $(document).find("orders").children().eq(4).append("<paid>true</paid>"); // Find those orders that are paid and flag them as "settled" $(document).find("orders").children().find("paid").after("<settled>true</settled>"); // Add a complex element $(document).find("orders").append( $("order", $("date", "2011-08-14"), $("amount", "155"), $("paid", "false"), $("settled", "false")).attr("id", "13");