## Uses of Interface
javax.xml.stream.XMLStreamWriter

- Packages that use XMLStreamWriter
  Package | Description
  --- | ---
  javax.xml.bind | Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.
  javax.xml.bind.helpers | JAXB Provider Use Only: Provides partial default implementations for some of the `javax.xml.bind` interfaces.
  javax.xml.stream |
  javax.xml.transform.stax | Provides for StAX-specific transformation APIs.

- - ### Uses of XMLStreamWriter in javax.xml.bind

    Methods in javax.xml.bind with parameters of type XMLStreamWriter
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | Marshaller.`marshal(Object jaxbElement, XMLStreamWriter writer)` Marshal the content tree rooted at `jaxbElement` into a `XMLStreamWriter`.

  - ### Uses of XMLStreamWriter in javax.xml.bind.helpers

    Methods in javax.xml.bind.helpers with parameters of type XMLStreamWriter
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | AbstractMarshallerImpl.`marshal(Object obj, XMLStreamWriter writer)`

  - ### Uses of XMLStreamWriter in javax.xml.stream

    Methods in javax.xml.stream that return XMLStreamWriter
    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract XMLStreamWriter` | XMLOutputFactory.`createXMLStreamWriter(OutputStream stream)` Create a new XMLStreamWriter that writes to a stream
    `abstract XMLStreamWriter` | XMLOutputFactory.`createXMLStreamWriter(OutputStream stream, String encoding)` Create a new XMLStreamWriter that writes to a stream
    `abstract XMLStreamWriter` | XMLOutputFactory.`createXMLStreamWriter(Result result)` Create a new XMLStreamWriter that writes to a JAXP result.
    `abstract XMLStreamWriter` | XMLOutputFactory.`createXMLStreamWriter(Writer stream)` Create a new XMLStreamWriter that writes to a writer

  - ### Uses of XMLStreamWriter in javax.xml.transform.stax

    Methods in javax.xml.transform.stax that return XMLStreamWriter
    Modifier and Type | Method | Description
    --- | --- | ---
    `XMLStreamWriter` | StAXResult.`getXMLStreamWriter()` Get the `XMLStreamWriter` used by this `StAXResult`.

    Constructors in javax.xml.transform.stax with parameters of type XMLStreamWriter
    Constructor | Description
    --- | ---
    `StAXResult(XMLStreamWriter xmlStreamWriter)` Creates a new instance of a `StAXResult` by supplying an `XMLStreamWriter`.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.