[UIMA-2101] add slightly reworked patch.  changes include reverting casts in getFeatureAttributes for array types (they started out as (StringArrayFS) but the patch had (StringArrayFSImpl), which fails if the Cas passed in has had its JCas version requested. Merged the test case with the existing test case.  The asserts were slightly modified to reflect the fact that the formatted version doesn't insert a new-line before the first <Document> tag. Also improved existing test case to test the result of the operation (not just print it out)

git-svn-id: https://svn.apache.org/repos/asf/uima/uimaj/trunk@1587675 13f79535-47bb-0310-9956-ffa450edef68