There is a whole chapter on it in the InDesign Scripting Guide.
Look at the XML Rules chapter. Hope that helps.
I would strongly discourage using the XML Rules logic in InDesign. It's very confusing to code, and while it has a template-based paradigm that might be familiar to those familiar with XSLT, it is pretty cumbersome to use. In my view, the sample code is also pretty problematic, because they don't show you how to parameterize it, and they depend a lot on code reptition.
I'd encourage you to look at my example from Re: How to shift content with in cell in xml rules table (reply #20).
Instead of all that, though, why not just use evaluateXPathExpression?
var root = app.activeDocument.xmlElements; var e = root.evaluateXPathExpression("/catalog/course1/title");
You may have to adjust it a bit, of course.