Java Code Examples for javax.xml.stream.XMLStreamWriter#writeStartElement()

The following examples show how to use javax.xml.stream.XMLStreamWriter#writeStartElement() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseBpmnXMLConverter.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
protected void writeTerminateDefinition(Event parentEvent, TerminateEventDefinition terminateDefinition, XMLStreamWriter xtw) throws Exception {
  xtw.writeStartElement(ELEMENT_EVENT_TERMINATEDEFINITION);
  
  if (terminateDefinition.isTerminateAll()) {
  	writeQualifiedAttribute(ATTRIBUTE_TERMINATE_ALL, "true", xtw);
  }
  
  if (terminateDefinition.isTerminateMultiInstance()) {
    writeQualifiedAttribute(ATTRIBUTE_TERMINATE_MULTI_INSTANCE, "true", xtw);
  }
  
  boolean didWriteExtensionStartElement = BpmnXMLUtil.writeExtensionElements(terminateDefinition, false, xtw);
  if (didWriteExtensionStartElement) {
    xtw.writeEndElement();
  }
  xtw.writeEndElement();
}
 
Example 2
Source File: AtomFeedSerializer.java    From olingo-odata2 with Apache License 2.0 6 votes vote down vote up
private void appendAtomSelfLink(final XMLStreamWriter writer, final EntityInfoAggregator eia)
    throws EntityProviderException {

  URI self = properties.getSelfLink();
  String selfLink = "";
  if (self == null) {
    selfLink = createSelfLink(eia);
  } else {
    selfLink = self.toASCIIString();
  }
  try {
    writer.writeStartElement(FormatXml.ATOM_LINK);
    writer.writeAttribute(FormatXml.ATOM_HREF, selfLink);
    writer.writeAttribute(FormatXml.ATOM_REL, Edm.LINK_REL_SELF);
    writer.writeAttribute(FormatXml.ATOM_TITLE, eia.getEntitySetName());
    writer.writeEndElement();
  } catch (XMLStreamException e) {
    throw new EntityProviderProducerException(EntityProviderException.COMMON, e);
  }
}
 
Example 3
Source File: AbstractPolicyBasedAuthorizer.java    From nifi-registry with Apache License 2.0 6 votes vote down vote up
private void writeGroup(final XMLStreamWriter writer, final Group group) throws XMLStreamException {
    List<String> users = new ArrayList<>(group.getUsers());
    Collections.sort(users);

    writer.writeStartElement(GROUP_ELEMENT);
    writer.writeAttribute(IDENTIFIER_ATTR, group.getIdentifier());
    writer.writeAttribute(NAME_ATTR, group.getName());

    for (String user : users) {
        writer.writeStartElement(GROUP_USER_ELEMENT);
        writer.writeAttribute(IDENTIFIER_ATTR, user);
        writer.writeEndElement();
    }

    writer.writeEndElement();
}
 
Example 4
Source File: SAAJMessage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example 5
Source File: CustomMarshaller.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Override
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
  resourceModel = resourceModel.get(attribute.getXmlName());
  writer.writeStartElement(attribute.getName());
  final List<Property> properties = resourceModel.asPropertyList();
  for (Property property: properties) {
    writer.writeStartElement(org.jboss.as.controller.parsing.Element.PROPERTY.getLocalName());
    writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(), property.getName());
    writer.writeCharacters(property.getValue().asString());
    writer.writeEndElement();
  }
  writer.writeEndElement();
}
 
Example 6
Source File: AbstractHandlerDefinition.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void marshallAsElement(final AttributeDefinition attribute, final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException {
    if (isMarshallable(attribute, resourceModel, marshallDefault)) {
        writer.writeStartElement(attribute.getXmlName());
        writer.writeStartElement(PatternFormatterResourceDefinition.PATTERN_FORMATTER.getXmlName());
        final String pattern = resourceModel.get(attribute.getName()).asString();
        writer.writeAttribute(PatternFormatterResourceDefinition.PATTERN.getXmlName(), pattern);
        writer.writeEndElement();
        writer.writeEndElement();
    }
}
 
Example 7
Source File: TableauMessageBodyGenerator.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
private void writeNativeDrillConnection(XMLStreamWriter xmlStreamWriter, DatasetConfig datasetConfig, String hostname) throws XMLStreamException {
  DatasetPath dataset = new DatasetPath(datasetConfig.getFullPathList());

  xmlStreamWriter.writeStartElement("connection");

  xmlStreamWriter.writeAttribute("class", "drill");
  xmlStreamWriter.writeAttribute("connection-type", "Direct");
  xmlStreamWriter.writeAttribute("authentication", "Basic Authentication");

  xmlStreamWriter.writeAttribute("odbc-connect-string-extras", "");
  // It has to match what is returned by the driver/Tableau
  xmlStreamWriter.writeAttribute("schema", dataset.toParentPath());
  xmlStreamWriter.writeAttribute("port", String.valueOf(endpoint.getUserPort()));
  xmlStreamWriter.writeAttribute("server", hostname);

  writeRelation(xmlStreamWriter, datasetConfig);
  if (customizationEnabled) {
    writeConnectionCustomization(xmlStreamWriter);
  }

  /* DX-7447 - When using the drill driver, Tableau will show an misleading error message because it could not connect
    to Dremio since it doesn't have the username/password (and doesn't prompt for them first).  To work around this,
    we generate metadata for the Dataset and add it to the .tds file.  This prefills the schema in Tableau and when
    the user starts working with the schema it will prompt the user to authenticate with Dremio.
  */
  writeTableauMetadata(xmlStreamWriter, datasetConfig);

  xmlStreamWriter.writeEndElement();
}
 
Example 8
Source File: AbstractConfig.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
protected void write(XMLStreamWriter writer) throws XMLStreamException {
    writer.writeStartDocument();
    writer.writeStartElement(getRootElemName());
    writer.writeAttribute(ATTR_VERSION, String.valueOf(version));
    doWrite(writer);
    writer.writeEndElement();
    writer.writeEndDocument();
}
 
Example 9
Source File: RelatesToHeader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(XMLStreamWriter w) throws XMLStreamException {
    w.writeStartElement("", name.getLocalPart(), name.getNamespaceURI());
    w.writeDefaultNamespace(name.getNamespaceURI());
    if (type != null)
        w.writeAttribute("type", type);
    w.writeCharacters(value);
    w.writeEndElement();
}
 
Example 10
Source File: SequenceFlowXMLConverter.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
protected void writeAdditionalChildElements(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception {
    SequenceFlow sequenceFlow = (SequenceFlow) element;

    if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
        xtw.writeStartElement(ELEMENT_FLOW_CONDITION);
        xtw.writeAttribute(XSI_PREFIX, XSI_NAMESPACE, "type", "tFormalExpression");
        xtw.writeCData(sequenceFlow.getConditionExpression());
        xtw.writeEndElement();
    }
}
 
Example 11
Source File: MetadataDocumentXmlSerializer.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
/**
 * Appends references, e.g., to the OData Core Vocabulary, as defined in the OData specification
 * and mentioned in its Common Schema Definition Language (CSDL) document.
 */
private void appendReference(final XMLStreamWriter writer) throws XMLStreamException {
  for (final EdmxReference reference : serviceMetadata.getReferences()) {
    writer.writeStartElement(PREFIX_EDMX, REFERENCE, NS_EDMX);
    writer.writeAttribute(URI, reference.getUri().toASCIIString());

    List<EdmxReferenceInclude> includes = reference.getIncludes();
    for (EdmxReferenceInclude include : includes) {
      writer.writeStartElement(PREFIX_EDMX, INCLUDE, NS_EDMX);
      writer.writeAttribute(XML_NAMESPACE, include.getNamespace());
      if (include.getAlias() != null) {
        namespaceToAlias.put(include.getNamespace(), include.getAlias());
        // Reference Aliases are ignored for now since they are not V2 compatible
        writer.writeAttribute(XML_ALIAS, include.getAlias());
      }
      writer.writeEndElement();
    }

    List<EdmxReferenceIncludeAnnotation> includeAnnotations = reference.getIncludeAnnotations();
    for (EdmxReferenceIncludeAnnotation includeAnnotation : includeAnnotations) {
      writer.writeStartElement(PREFIX_EDMX, INCLUDE_ANNOTATIONS, NS_EDMX);
      writer.writeAttribute(XML_TERM_NAMESPACE, includeAnnotation.getTermNamespace());
      if (includeAnnotation.getQualifier() != null) {
        writer.writeAttribute(XML_QUALIFIER, includeAnnotation.getQualifier());
      }
      if (includeAnnotation.getTargetNamespace() != null) {
        writer.writeAttribute(XML_TARGET_NAMESPACE, includeAnnotation.getTargetNamespace());
      }
      writer.writeEndElement();
    }

    writer.writeEndElement();
  }
}
 
Example 12
Source File: AbstractPolicyBasedAuthorizer.java    From nifi-registry with Apache License 2.0 5 votes vote down vote up
private void writePolicy(final XMLStreamWriter writer, final AccessPolicy policy) throws XMLStreamException {
    // sort the users for the policy
    List<String> policyUsers = new ArrayList<>(policy.getUsers());
    Collections.sort(policyUsers);

    // sort the groups for this policy
    List<String> policyGroups = new ArrayList<>(policy.getGroups());
    Collections.sort(policyGroups);

    writer.writeStartElement(POLICY_ELEMENT);
    writer.writeAttribute(IDENTIFIER_ATTR, policy.getIdentifier());
    writer.writeAttribute(RESOURCE_ATTR, policy.getResource());
    writer.writeAttribute(ACTIONS_ATTR, policy.getAction().name());

    for (String policyUser : policyUsers) {
        writer.writeStartElement(POLICY_USER_ELEMENT);
        writer.writeAttribute(IDENTIFIER_ATTR, policyUser);
        writer.writeEndElement();
    }

    for (String policyGroup : policyGroups) {
        writer.writeStartElement(POLICY_GROUP_ELEMENT);
        writer.writeAttribute(IDENTIFIER_ATTR, policyGroup);
        writer.writeEndElement();
    }

    writer.writeEndElement();
}
 
Example 13
Source File: XmiWriter.java    From secure-data-service with Apache License 2.0 5 votes vote down vote up
private static final void writeDataType(final DataType dataType, final ModelIndex mapper, final XMLStreamWriter xsw)
        throws XMLStreamException {
    xsw.writeStartElement(PREFIX_UML, XmiElementName.DATA_TYPE.getLocalName(), NAMESPACE_UML);
    try {
        writeId(dataType, xsw);
        xsw.writeAttribute(XmiAttributeName.NAME.getLocalName(), dataType.getName());
        xsw.writeAttribute("isAbstract", Boolean.toString(dataType.isAbstract()));
        writeModelElementTaggedValues(dataType, mapper, xsw);
    } finally {
        xsw.writeEndElement();
    }
}
 
Example 14
Source File: XMLServiceDocumentWriter.java    From odata with Apache License 2.0 5 votes vote down vote up
/**
 * Starts "service" document with correct attributes and also writes "workspace", "title" elements.
 *
 * @param outputStream stream to write to
 * @return XMLStreamWriter to which writing happens
 * @throws XMLStreamException   in case of errors
 * @throws ODataRenderException in case of errors
 */
private XMLStreamWriter startServiceDocument(ByteArrayOutputStream outputStream)
        throws XMLStreamException, ODataRenderException {
    XMLStreamWriter writer = XMLWriterUtil.startDocument(outputStream, null, SERVICE, ODATA_SERVICE_NS);
    writer.writeNamespace(ATOM, ATOM_NS);
    writer.writeNamespace(METADATA, ODATA_METADATA_NS);
    writer.writeNamespace(SERVICE_BASE, oDataUri.serviceRoot());
    writer.writeNamespace(ODATA_CONTEXT, getContextURL(oDataUri, entityDataModel));

    // WorkSpace element is only child of service document according to specifications.
    writer.writeStartElement(ODATA_SERVICE_NS, WORKSPACE);
    writeTitle(writer, getEntityContainer().getName());

    return writer;
}
 
Example 15
Source File: SAAJMessage.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example 16
Source File: ModelItem.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
/** Write XML configuration common to all Model Items
 *  @param writer {@link XMLStreamWriter}
 *  @throws Exception on error
 */
protected void writeCommonConfig(final XMLStreamWriter writer) throws Exception
{
    writer.writeStartElement(XMLPersistence.TAG_DISPLAYNAME);
    writer.writeCharacters(getDisplayName());
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_VISIBLE);
    writer.writeCharacters(Boolean.toString(isVisible()));
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_NAME);
    writer.writeCharacters(getName());
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_AXIS);
    writer.writeCharacters(Integer.toString(getAxisIndex()));
    writer.writeEndElement();

    XMLPersistence.writeColor(writer, XMLPersistence.TAG_COLOR, getPaintColor());

    writer.writeStartElement(XMLPersistence.TAG_TRACE_TYPE);
    writer.writeCharacters(getTraceType().name());
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_LINEWIDTH);
    writer.writeCharacters(Integer.toString(getLineWidth()));
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_LINE_STYLE);
    writer.writeCharacters(getLineStyle().name());
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_POINT_TYPE);
    writer.writeCharacters(getPointType().name());
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_POINT_SIZE);
    writer.writeCharacters(Integer.toString(getPointSize()));
    writer.writeEndElement();

    writer.writeStartElement(XMLPersistence.TAG_WAVEFORM_INDEX);
    writer.writeCharacters(Integer.toString(getWaveformIndex()));
    writer.writeEndElement();
}
 
Example 17
Source File: AbstractPlanItemDefinitionExport.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
protected void writePlanItemDefinitionStartElement(T planItemDefinition, XMLStreamWriter xtw) throws Exception {
    xtw.writeStartElement(getPlanItemDefinitionXmlElementValue(planItemDefinition));
}
 
Example 18
Source File: SecureConversationToken.java    From steady with Apache License 2.0 4 votes vote down vote up
public void serialize(XMLStreamWriter writer) throws XMLStreamException {

        String localname = getRealName().getLocalPart();
        String namespaceURI = getRealName().getNamespaceURI();
        String prefix;

        String writerPrefix = writer.getPrefix(namespaceURI);

        if (writerPrefix == null) {
            prefix = getRealName().getPrefix();
            writer.setPrefix(prefix, namespaceURI);
        } else {
            prefix = writerPrefix;
        }

        // <sp:SecureConversationToken>
        writer.writeStartElement(prefix, localname, namespaceURI);

        if (writerPrefix == null) {
            // xmlns:sp=".."
            writer.writeNamespace(prefix, namespaceURI);
        }

        String inclusion;

        inclusion = constants.getAttributeValueFromInclusion(getInclusion());

        if (inclusion != null) {
            writer.writeAttribute(prefix, namespaceURI, SPConstants.ATTR_INCLUDE_TOKEN, inclusion);
        }

        if (issuerEpr != null) {
            // <sp:Issuer>
            writer.writeStartElement(prefix, SPConstants.ISSUER, namespaceURI);

            StaxUtils.copy(issuerEpr, writer);

            writer.writeEndElement();
        }

        if (isDerivedKeys() || isRequireExternalUriRef() || isSc10SecurityContextToken()
            || isSc13SecurityContextToken() || bootstrapPolicy != null) {

            String wspNamespaceURI = SPConstants.POLICY.getNamespaceURI();

            String wspPrefix;

            String wspWriterPrefix = writer.getPrefix(wspNamespaceURI);

            if (wspWriterPrefix == null) {
                wspPrefix = SPConstants.POLICY.getPrefix();
                writer.setPrefix(wspPrefix, wspNamespaceURI);

            } else {
                wspPrefix = wspWriterPrefix;
            }

            // <wsp:Policy>
            writer.writeStartElement(wspPrefix, SPConstants.POLICY.getLocalPart(), wspNamespaceURI);

            if (wspWriterPrefix == null) {
                // xmlns:wsp=".."
                writer.writeNamespace(wspPrefix, wspNamespaceURI);
            }

            if (isDerivedKeys()) {
                // <sp:RequireDerivedKeys />
                writer.writeEmptyElement(prefix, SPConstants.REQUIRE_DERIVED_KEYS, namespaceURI);
            }

            if (isRequireExternalUriRef()) {
                // <sp:RequireExternalUriReference />
                writer.writeEmptyElement(prefix, SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE, namespaceURI);
            }

            if (isSc10SecurityContextToken()) {
                // <sp:SC10SecurityContextToken />
                writer.writeEmptyElement(prefix, SPConstants.SC10_SECURITY_CONTEXT_TOKEN, namespaceURI);
            }
            
            if (isSc13SecurityContextToken()) {
                // <sp:SC13SecurityContextToken />
                writer.writeEmptyElement(prefix, SPConstants.SC13_SECURITY_CONTEXT_TOKEN, namespaceURI);
            }

            if (bootstrapPolicy != null) {
                // <sp:BootstrapPolicy ..>
                writer.writeStartElement(prefix, SPConstants.BOOTSTRAP_POLICY, namespaceURI);
                bootstrapPolicy.serialize(writer);
                writer.writeEndElement();
            }

            // </wsp:Policy>
            writer.writeEndElement();
        }

        // </sp:SecureConversationToken>
        writer.writeEndElement();
    }
 
Example 19
Source File: GraphMLWriter.java    From tinkerpop with Apache License 2.0 4 votes vote down vote up
/**
 * Write the data in a Graph to a GraphML OutputStream.
 *
 * @param outputStream the GraphML OutputStream to write the Graph data to
 * @throws IOException thrown if there is an error generating the GraphML data
 */
@Override
public void writeGraph(final OutputStream outputStream, final Graph g) throws IOException {
    final Map<String, String> identifiedVertexKeyTypes = this.vertexKeyTypes.orElseGet(() -> GraphMLWriter.determineVertexTypes(g));
    final Map<String, String> identifiedEdgeKeyTypes = this.edgeKeyTypes.orElseGet(() -> GraphMLWriter.determineEdgeTypes(g));

    if (identifiedEdgeKeyTypes.containsKey(this.edgeLabelKey))
        throw new IllegalStateException(String.format("The edgeLabelKey value of[%s] conflicts with the name of an existing property key to be included in the GraphML", this.edgeLabelKey));
    if (identifiedEdgeKeyTypes.containsKey(this.edgeLabelKey))
        throw new IllegalStateException(String.format("The vertexLabelKey value of[%s] conflicts with the name of an existing property key to be included in the GraphML", this.vertexLabelKey));

    identifiedEdgeKeyTypes.put(this.edgeLabelKey, GraphMLTokens.STRING);
    identifiedVertexKeyTypes.put(this.vertexLabelKey, GraphMLTokens.STRING);

    try {
        final XMLStreamWriter writer;
        writer = configureWriter(outputStream);

        writer.writeStartDocument();
        writer.writeStartElement(GraphMLTokens.GRAPHML);
        writeXmlNsAndSchema(writer);

        writeTypes(identifiedVertexKeyTypes, identifiedEdgeKeyTypes, writer);

        writer.writeStartElement(GraphMLTokens.GRAPH);
        writer.writeAttribute(GraphMLTokens.ID, GraphMLTokens.G);
        writer.writeAttribute(GraphMLTokens.EDGEDEFAULT, GraphMLTokens.DIRECTED);

        writeVertices(writer, g);
        writeEdges(writer, g);

        writer.writeEndElement(); // graph
        writer.writeEndElement(); // graphml
        writer.writeEndDocument();

        writer.flush();
        writer.close();
    } catch (XMLStreamException xse) {
        throw new IOException(xse);
    }
}
 
Example 20
Source File: CommonIronJacamarParser.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Store a XA pool
 * @param pool The pool
 * @param writer The writer
 * @exception Exception Thrown if an error occurs
 */
protected void storeXaPool(XaPool pool, XMLStreamWriter writer) throws Exception
{
   writer.writeStartElement(CommonXML.ELEMENT_XA_POOL);

   if (pool.getType() != null)
      writer.writeAttribute(CommonXML.ATTRIBUTE_TYPE,
                            pool.getValue(CommonXML.ATTRIBUTE_TYPE, pool.getType()));

   if (pool.getType() != null)
      writer.writeAttribute(CommonXML.ATTRIBUTE_JANITOR,
                            pool.getValue(CommonXML.ATTRIBUTE_JANITOR, pool.getJanitor()));

   if (pool.getMinPoolSize() != null && (pool.hasExpression(CommonXML.ELEMENT_MIN_POOL_SIZE) ||
                                         !Defaults.MIN_POOL_SIZE.equals(pool.getMinPoolSize())))
   {
      writer.writeStartElement(CommonXML.ELEMENT_MIN_POOL_SIZE);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_MIN_POOL_SIZE, pool.getMinPoolSize().toString()));
      writer.writeEndElement();
   }

   if (pool.getInitialPoolSize() != null)
   {
      writer.writeStartElement(CommonXML.ELEMENT_INITIAL_POOL_SIZE);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_INITIAL_POOL_SIZE,
                                           pool.getInitialPoolSize().toString()));
      writer.writeEndElement();
   }

   if (pool.getMaxPoolSize() != null && (pool.hasExpression(CommonXML.ELEMENT_MAX_POOL_SIZE) ||
                                         !Defaults.MAX_POOL_SIZE.equals(pool.getMaxPoolSize())))
   {
      writer.writeStartElement(CommonXML.ELEMENT_MAX_POOL_SIZE);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_MAX_POOL_SIZE, pool.getMaxPoolSize().toString()));
      writer.writeEndElement();
   }

   if (pool.isPrefill() != null && (pool.hasExpression(CommonXML.ELEMENT_PREFILL) ||
                                    !Defaults.PREFILL.equals(pool.isPrefill())))
   {
      writer.writeStartElement(CommonXML.ELEMENT_PREFILL);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_PREFILL, pool.isPrefill().toString()));
      writer.writeEndElement();
   }

   if (pool.getFlushStrategy() != null && (pool.hasExpression(CommonXML.ELEMENT_FLUSH_STRATEGY) ||
                                           !Defaults.FLUSH_STRATEGY.equals(pool.getFlushStrategy())))
   {
      writer.writeStartElement(CommonXML.ELEMENT_FLUSH_STRATEGY);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_FLUSH_STRATEGY, pool.getFlushStrategy().toString()));
      writer.writeEndElement();
   }

   if (pool.getCapacity() != null)
      storeCapacity(pool.getCapacity(), writer);

   if (pool.isIsSameRmOverride() != null)
   {
      writer.writeStartElement(CommonXML.ELEMENT_IS_SAME_RM_OVERRIDE);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_IS_SAME_RM_OVERRIDE,
                                           pool.isIsSameRmOverride().toString()));
      writer.writeEndElement();
   }

   if (pool.isPadXid() != null && (pool.hasExpression(CommonXML.ELEMENT_PAD_XID) ||
                                   !Defaults.PAD_XID.equals(pool.isPadXid())))
   {
      writer.writeStartElement(CommonXML.ELEMENT_PAD_XID);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_PAD_XID, pool.isPadXid().toString()));
      writer.writeEndElement();
   }

   if (pool.isWrapXaResource() != null && (pool.hasExpression(CommonXML.ELEMENT_WRAP_XA_RESOURCE) ||
                                           !Defaults.WRAP_XA_RESOURCE.equals(pool.isWrapXaResource())))
   {
      writer.writeStartElement(CommonXML.ELEMENT_WRAP_XA_RESOURCE);
      writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_WRAP_XA_RESOURCE, pool.isWrapXaResource().toString()));
      writer.writeEndElement();
   }

   writer.writeEndElement();
}