/**
  * INTERNAL: When using the SAX or DOM Platform, this method is responsible for marshalling null
  * values for the XML Direct Mapping.
  *
  * @param xPathFragment
  * @param marshalRecord
  * @param object
  * @param session
  * @param namespaceResolver
  * @return true if this method caused any nodes to be marshaled, else false.
  */
 public boolean directMarshal(
     XPathFragment xPathFragment,
     MarshalRecord marshalRecord, //
     Object object,
     CoreSession session,
     NamespaceResolver namespaceResolver) {
   // Handle attributes - XSI_NIL, ABSENT_NODE have the same behavior
   if (xPathFragment.isAttribute()) {
     // Write out an empty attribute
     if (marshalNullRepresentation == XMLNullRepresentationType.EMPTY_NODE) {
       marshalRecord.emptyAttribute(xPathFragment, namespaceResolver);
       return true;
     } else {
       // XSI_NIL attributes are invalid - and are ignored
       // ABSENT_NODE - Write out nothing
       return false;
     }
   } else {
     // Nillable: write out xsi:nil="true" attribute in empty element
     if (marshalNullRepresentation == XMLNullRepresentationType.XSI_NIL) {
       marshalRecord.nilSimple(namespaceResolver);
       return true;
     } else {
       // EMPTY_NODE - Write out empty element
       if (marshalNullRepresentation == XMLNullRepresentationType.EMPTY_NODE) {
         marshalRecord.emptySimple(namespaceResolver);
         return true;
       } else {
         // ABSENT_NODE - Write out nothing
         return false;
       }
     }
   }
 }