Issue with array structures in XML and JSON API with "generate 1"

My use case is to simulate a search with exactly one result, where also multiple results are possible. Basically the Web Service reply should be an array with one element.
I have tried XML and JSON APIs.

1/ JSON: The result is the correct JSON structure except that the brackets “[” and “]” for the array are missing. I tried the query string array=true which did not help.
{“KD_NR_INH”:215393829,“KD_STAT_CD”:true,“SPRACHE_CD”:1,“GEBURT_DAT”:“09.03.1998”,“KT_NR”:“67 0.023.013.43”,“EDIT_KT_GNR”:“7439087-40”,“RUBRIK_BEZ”:“7439087-40 - {_Rubrik}”,“KD_GESCHLECHT_CD”:“2”,“ANREDE_CD”:2,“ANREDE_CD_BEZ”:“Sehr geehrte Frau”,

2/ XML: The result is the correct repeating structure “record”, but the XML header and “dataset” are not generated.

<KD_LNR_BERATER>12340</KD_LNR_BERATER>
<USER_ID>WEK</USER_ID>
<KD_GESCHLEC

Maybe I should use another concept to retrieve 1 result. IMHO the structure of the reply should be the same whether I retrieve one ore multiple records.

Help is very much appreciated.

XML Code was not shown in example above
<record> <KD_LNR_BERATER>12340</KD_LNR_BERATER> <USER_ID>WEK</USER_ID> <KD_GESCHLECHT_CD>1</KD_GESCHLECHT_CD> <Anrede>Herr</Anrede> <Vorname>Maude</Vorname> <Name>Seyfart</Name> <Email/> <KD_LNR_BERAT_BEZ>Maude Seyfart</KD_LNR_BERAT_BEZ>

After a couple of “trial and errors” and google i managed to find a solution:

# customer with customerNumber GET /users.json?kdnr=296676610
schema "Kunde"

# generate one customer record
customer = generate 1

# set return value of customer to query parameter
customer['KD_NR_INH'] = params['kdnr']

# output modified record as array
Array.wrap(customer)