Added support for return types as Arrays instead of Strings
Corrected XML handling when root is an Array