The document you are using to generate the output has those fields defined (even if empty) or set as null?
Are those fields set as required=true in the original document type?
I don’t know if there is a better way, but before converting to XML, you could use a BRANCH operation on that field and use a MAP operation to drop the field from the document if it’s empty (leave the label empty) or if it’s null (another operation whose label is set to $null).