Element Document reference can only be used for Invoice line object
PEPPOL-EN16931-R101
cac:InvoiceLine | cac:CreditNoteLine
(not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130'))