 element) throws Exception {
    if (element!= null) {
      composeElementAttributes(element);
      xml.enter(FHIR_NS, name);
      composeBackboneElements(element);
      if (element.hasIdentifierElement()) {
        composeId("identifier", element.getIdentifierElement());
      }
      if (element.hasCodeElement())
        composeEnumeration("code", element.getCodeElement(), new MessageHeader.ResponseTypeEnumFactory());
      if (element.hasDetails()) {
        composeReference("details", element.getDetails());
      }
      composeElementClose(element);
      xml.exit(FHIR_NS, name);
    }
  }

  protected void composeMessageHeaderMessageSourceComponent(String name, MessageHeader.MessageSourceComponent element) throws Exception {
    if (element!= null) {
      composeElementAttributes(element);
      xml.enter(FHIR_NS, name);
      composeBackboneElements(element);
      if (element.hasNameElement()) {
        composeString("name", element.getNameElement());
      }
      if (element.hasSoftwareElement()) {
        composeString("software", element.getSoftwareElement());
      }
      if (element.hasVersionElement()) {
        composeString("version", element.getVersionElement());
      }
      if (element.hasContact()) {
        composeContactPoint("contact", element.getContact());
      }
      if (element.hasEndpointElement()) {
        composeUri("endpoint", element.getEndpointElement());
      }
      composeElementClose(element);
      xml.exit(FHIR_NS, name);
    }
  }

  protected void composeMessageHeaderMessageDestinationComponent(String name, MessageHeader.MessageDestinationComponent element) throws Exception {
    if (element!= null) {
      composeElementAttributes(element);
      xml.enter(FHIR_NS, name);
      composeBackboneElements(element);
      if (element.hasNameElement()) {
        composeString("name", element.getNameElement());
      }
      if (element.hasTarget()) {
        composeReference("target", element.getTarget());
      }
      if (element.hasEndpointElement()) {
        composeUri("endpoint", element.getEndpointElement());
      }
      composeElementClose(element);
      xml.exit(FHIR_NS, name);
    }
  }

  protected void composeNamingSystem(String name, NamingSystem element) throws Exception {
    if (element!= null) {
      composeDomainResourceAttributes(element);
      xml.enter(FHIR_NS, name);
      composeDomainResourceElements(element);
      if (element.hasNameElement()) {
        composeString("name", element.getNameElement());
      }
      if (element.hasStatusElement())
        composeEnumeration("status", element.getStatusElement(), new Enumerations.ConformanceResourceStatusEnumFactory());
      if (element.hasKindElement())
        composeEnumeration("kind", element.getKindElement(), new NamingSystem.NamingSystemTypeEnumFactory());
      if (element.hasPublisherElement()) {
        composeString("publisher", element.getPublisherElement());
      }
      if (element.hasContact()) { 
        for (NamingSystem.NamingSystemContactComponent e : element.getContact()) 
          composeNamingSystemNamingSystemContactComponent("contact", e);
      }
      if (element.hasResponsibleElement()) {
        composeString("responsible", element.getResponsibleElement());
      }
      if (element.hasDateElement()) {
        composeDateTime("date", element.getDateElement());
      }
      if (element.hasType()) {
        composeCodeableConcept("type", element.getType());
      }
      if (element.hasDescriptionElement()) {
        composeString("description", element.getDescriptionElement());
      }
      if (element.hasUseContext()) { 
        for (CodeableConcept e : element.getUseContext()) 
          composeCodeableConcept("useContext", e);
      }
      if (element.hasUsageElement()) {
        composeString("usage", element.getUsageElement());
      }
      if (element.hasUniqueId()) { 
        for (NamingSystem.NamingSystemUniqueIdComponent e : element.getUniqueId()) 
          composeNamingSystemNamingSystemUniqueIdComponent("uniqueId", e);
      }
      if (element.hasReplacedBy()) {
        composeReference("replacedBy", element.getReplacedBy());
      }
      composeElementClose(element);
      xml.exit(FHIR_NS, name);
    }
  }

  protected void composeNamingSystemNamingSystemContactComponent(String name, NamingSystem.NamingSystemContactComponent element) throws Exception {
    if (element!= null) {
      composeElementAttributes(element);
      xml.enter(FHIR_NS, name);
      composeBackboneElements(element);
      if (element.hasNameElement()) {
        composeString("name", element.getNameElement());
      }
      if (element.hasTelecom()) { 
        for (ContactPoint e : element.getTelecom()) 
          composeContactPoint("telecom", e);
      }
      composeElementClose(element);
      xml.exit(FHIR_NS, name);
    }
  }

  protected void composeNamingSystemNamingSystemUniqueIdComponent(String name, NamingSystem.NamingSystemUniqueIdComponent element) throws Exception {
    if (element!= null) {
      composeElementAttributes(element);
      xml.enter(FHIR_NS, name);
      composeBackboneElements(element);
      if (element.hasTypeElement())
        composeEnumeration("type", element.getTypeElement(), new NamingSystem.NamingSystemIdentifierTypeEnumFactory());
      if (element.hasValueElement()) {
        composeString("value", element.getValueElement());
      }
      if (element.hasPreferredElement()) {
        composeBoolean("preferred", element.getPreferredElement());
      }
      if (element.hasPeriod()) {
        composePeriod("period", element.getPeriod());
      }
      composeElementClose(element);
      xml.exit(FHIR_NS, name);
    }
  }

  protected void composeNutritionOrder(String name, NutritionOrder element) throws Exception {
    if (element!= null) {
      composeDomainResourceAttributes(element);
      xml.enter(FHIR_NS, name);
      composeDomainResourceElements(element);
      if (element.hasPatient()) {
        composeReference("patient", element.getPatient());
      }
      if (element.hasOrderer()) {
        composeReference("orderer", element.getOrderer());
      }
      if (element.hasIdentifier()) { 
        for (Identifier e : element.getIdentifier()) 
          composeIdentifier("identifier", e);
      }
      if (element.hasEncounter()) {
        composeReference("encounter", element.getEncounter());
      }
      if (element.hasDateTimeElement()) {
        composeDateTime("dateTime", element.getDateTimeElement());
      }
      if (element.hasStatusElement())
        composeEnumeration("status", element.getStatusElement(), new NutritionOrder.NutritionOrderStatusEnumFactory());
      if (element.hasAllergyIntolerance()) { 
        for (Reference e : element.getAllergyIntolerance()) 
          composeReference("allergyIntolerance", e);
      }
      if (element.hasFoodPreferenceModifier()) { 
        for (CodeableConcept e : element.getFoodPreferenceModifier()) 
          composeCodeableConcept("foodPreferenceModifier", e);
      }
      if (element.hasExcludeFoodModifier()) { 
        for (CodeableConcept e : element.getExcludeFoodModifier()) 
          composeCodeableConcept("excludeFoodModifier", e);
      }
      if (element.hasOralDiet()) {
        composeNutritionOrderNutritionOrderOralDietComponent("oralDiet", element.getOralDiet());
      }
      if (element.hasSupplement()) { 
        for (NutritionOrder.NutritionOrderSupplementComponent e : element.getSupplement()) 
          composeNutritionOrderNutritionOrderSupplementComponent("supplement", e);
      }
      if (element.hasEnteralFormula()) {
        composeNutritionOrderN