Let's say I have a class called Store that has a lot of employees. The RESTful listXML method is as follows:
def listXML = {
render Store.list() as XML
}
And the result will look like this:
<stores>
<store id="1">
<name>My Store</name>
<employees>
<employee id="1" />
</employees>
</store>
</store>
My question is: how do I include all the data of each Employee class so that my XML looks something like this?
<stores>
<store id="1">
<name>My Store</name>
<employees>
<employee id="1">
<name>John Smith</name>
<hireDate>2008-01-01</hireDate>
</employee>
</employees>
</store>
</store>
source
share