There is something wrong in FCC as per your requirement.
ITEM_SUB_B is child of Line_B. Due to this, Line_B's endSeparator only work when it come to end of this context. So, it put all elements in one line only.
To full fill your requirement you have to use beginSeparator at ITEM_SUB_B.
So it's like xml.ITEM_SUB_B.beginSeparator = 'nl'.
This statement will add a new line before writing ITEM_SUB_B elements.
Hope it will be help in case of your requirement.