account for functions in XML serializer.

it was returning the body of the function, not the result.
which is not so good