Here a simple example of XIncProc XPointer Api Usage
The expression to find node "genre" with XPointer Framework is very simple: "bk101" (see Shorthand Pointer)
Code to find "genre" node with XPointer engine is as simple as this:
XPointerEngine xPointerEngine = new XPointerEngine();
String result = xPointerEngine.execute("bk101", source);
And result will be <genre id="bk101">Computer</genre>
The document used in the sample :
<catalog> <book > <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <genre id="bk101">Computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>An in-depth look at creating applications with XML.</description> </book> </catalog>