I assume that in your example input, </InvoiceNum> is a typo for <InvoiceNum/>.
In XSLT 2.0
<xsl:template match="LIST">
<xsl:for-each-group group-starting-with="Invoice[InvoiceNum != '']">
<Invoice>
<xsl:copy-of select="InvoiceNum"/>
<xsl:copy-of select="current-group()/Delivery"/>
</Invoice>
</
</
In 1.0 (in case you're stuck with it) use sibling recursion. That is, apply-templates to Invoice[1], then in the template for Invoice (a) do an apply-templates to following-sibling::Invoice[1] (in a different mode) provided it has no InvoiceNum, and (b) do an apply-templates (in the original mode) to the first following-sibling::Invoice that does have an InvoiceNum.
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference