For each node, there's a method called 'dataType' that's supposedly return the data type of each field.
Unfortunately it's not functioning properly - it does return 'string' for simple text field, but returns 'null' for all other fields like XHTML, date/time stamp, integer, double, picture attachment, etc.
Have been trying to use this for more than a year, thought it has been fixed by now :)