XPath常用的用法下面是演示代码<?xml version="1.0" encoding="UTF-8"?> Harry Potter 29.99 Learning XML 39.95 选择整个标签选择多个title标签推荐下面两种方法：/bookstore/book/title //*[@lang="eng"] 提取文字提取 Harry Potter/bookstore/book/title/text()[1] /bookstore/book/text()[1] /bookstore/book/title/text() /bookstore/book/text() 选择文字等于keyword的标签/bookstore/book/title[.="{keyword}"] 相关参考菜鸟教程