common_helper/src/main/java/com/xiongyingqi/util/xml/StaxUtils.java
public static XMLStreamWriter getXMLStreamWriter(Result result) {
        if (result instanceof StAXResult) {
            return ((StAXResult) result).getXMLStreamWriter();
        } else if (result instanceof StaxResult) {
            return ((StaxResult) result).getXMLStreamWriter();
        } else {
            throw new IllegalArgumentException("Result '" + result + "' is neither StaxResult nor StAXResult");
        }
    }
public static XMLStreamWriter getXMLStreamWriter(Result result) {
        if (result instanceof StAXResult) {
            return ((StAXResult) result).getXMLStreamWriter();
        } else if (result instanceof StaxResult) {
            return ((StaxResult) result).getXMLStreamWriter();
        } else {
            throw new IllegalArgumentException("Result '" + result + "' is neither StaxResult nor StAXResult");
        }
    }
Return the {@link javax.xml.stream.XMLStreamWriter} for the given StAX Result.

@param result a JAXP 1.4 {@link javax.xml.transform.stax.StAXResult}
@return the {@link javax.xml.stream.XMLStreamReader}
@throws IllegalArgumentException if {@code source} isn't a JAXP 1.4 {@link javax.xml.transform.stax.StAXResult}
or custom StAX Result