Build 6.0.29 (Probably applies to 5.4 also, but not tested)
When creating a BizDoc with xa:loop or xa:if (and other instructions), the execution output removes the xa: instruction and just displays the results. However, if outstreaming is enabled, then the <xa:loop>, <xa:if>, etc. instructions are output to the streamed file. In addition, the "xa" prefix/namespace is not output to the streamed file, so the XML result is invalid. (In the case of the <xa:if>, the tag is closed before the children it contains, so it is not the same structure as the BizDoc which wouldn't matter if the instruction isn't output in the first place.)
The BizDoc instructions should be reviewed with respect to the outstreaming behavior. I recommend where possible, the results should be the same whether streaming or not streaming.
See attached files, and resulting output.
oustream with xa:loop and xa:if examples