Hi Simon,
the problem seems to be structure of your Document.
Your schema is the following:
<CreateDelivery>
<Document>
<DocumentLines>
...
</DocumentLines>
...
</BatchNumbers>
</Document>
</CreateDelivery>
Please run the metadata retrieval (Maintenance -> Cfg Metadata) and check the B1 object help via Help -> B1 Object Help, display the Object List and check the Object Template for DeliveryNotes:
<Documents>
<row>
<!--multiple such elements are allowed-->
...
</row>
</Documents>
<Document_Lines>
<row><!--multiple such elements are allowed-->
...
</row>
</Document_Lines>
<BatchNumbers>
<row>
<!--multiple such elements are allowed-->
...
</row>
</BatchNumbers>
<DocumentLinesBinAllocations>
<row>
<!--multiple such elements are allowed-->
...
</row>
</DocumentLinesBinAllocations>
Best regards
Bastian