title: Get an InputStream/io.Reader from OMElement object
body: <p>I have a <code>OMElement</code> object and from that I want to get an <code>InputStream</code> or reader object. What I want is to stream the <code>xml</code> from the <code>OMElement</code> which I have, without getting loaded into memory.  I only could be able to get <code>XMLStreamReader</code> object from that. But I can't find a way to get <code>InputStream/Reader</code> out of that.</p>
  
  <pre><code>OMElement element /*I have this object */
  XMLStreamReader xmlreader = element.getXMLStreamReaderWithoutCaching();
  </code></pre>
  
  <p>Can anyone please help me ? I really appreciate!</p>
  
  <p>Thanks</p>
  
  <p>PS: I have come a way to get an InputStream but it gives an exception which I need help to resolve it.</p>
  
  <pre><code>XMLStreamReader xmlReader = element.getXMLStreamReader(false);
  
    try {
        if (xmlReader.getEventType() == XMLStreamReader.START_DOCUMENT) {
                  xmlReader.next();
         }
        DataHandler handler = XMLStreamReaderUtils.getDataHandlerFromElement(xmlReader);
        handler.getInputStream();
  </code></pre>
  
  <p>The call to getDataHandlerFromElement generate the exception <strong>javax.xml.stream.XMLStreamException: Error during base64 decoding</strong></p>