Given the following XML, what Xpath 2.0 query will get me the maximum date for each contact? My goals ito find contacts who haven't been touched in 30 days.
<contacts>
<contact>
<name>james</name>
<touch method='email' date='2002-02-04'>a</touch>
<touch method='meeting' date='2010-02-04'>b</touch>
</contact>
<contact>
<name>bob</name>
<touch method='phone' date='2001-02-04'>y</touch>
<touch method='email' date='2009-02-04'>d</touch>
</contact>
<contact>
<name>cindy</name>
<touch method='email' date='2012-02-04'>v</touch>
<touch method='phone' date='2012-02-04'>h</touch>
</contact>
<contact>
<name>john</name>
</contact>
</contacts>
max((//@date/xs:dateTime(.))) will get me a single maximum date but I'm trying to get three dates.