Fragmentation functions at next-to-next-to-leading order accuracy