I assume that in your example input, </InvoiceNum> is a typo for <InvoiceNum/>.
In XSLT 2.0
<xsl:for-each-group group-starting-with="Invoice[InvoiceNum != '']">
In 1.0 (in case you're stuck with it) use sibling recursion. That is, apply-templates to Invoice, then in the template for Invoice (a) do an apply-templates to following-sibling::Invoice (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.
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference