There are many situations where you might find that it would be useful if a class not under your control had additional methods that you define. We call these Categories. There are a few categories that are included in the system for adding functionality to classes that make them more usable within the Groovy environment.
The first category allows you to treat DOM objects as arrays and maps so that you can use them in conjunction with the Groovy path expression language and treat them like JavaBeans. Here is an example from the tests of using the DOMCategory: