title: How do I get rid of the xml:base attribute that is added to my xml document after using xinclude?
body: <p>I am trying to unmarshal an xml file to a java object using xinclude. I have a schema based on my jaxb-annotated code files. Here is my unmarshalling code:</p>
  
  <pre><code>@Override
  public T readFromReader(final Reader reader) throws Exception {
      final Unmarshaller unmarshaller = createUnmarshaller();
  
      final SAXParserFactory spf = SAXParserFactory.newInstance();
      spf.setXIncludeAware(true);
      spf.setNamespaceAware(true);
      //spf.setValidating(true);
  
      final XMLReader xr = spf.newSAXParser().getXMLReader();
      final InputSource inputSource = new InputSource(reader);
      xr.parse(inputSource)
  
      final SAXSource source = new SAXSource( xr, new InputSource(reader) );
  
  
      try {
          final T object = (T) unmarshaller.unmarshal(source);
          postReadSetup(object);
          return  object;
      } catch (final Exception e) {
          throw new RuntimeException("Cannot parse XML: Additional information is attached. Please ensure your XML is valid.", e);
      }
  }
  </code></pre>
  
  <p>Since I'm calling xr.parse(), the actual unmarshalling is not successful (because the parse closes the stream). However, I am getting a parsing error <strong>[Error] file-name.xml:2:66: cvc-complex-type.3.2.2: Attribute 'xml:base' is not allowed to appear in element 'element name'</strong>.</p>
  
  <p>I figured out that this is because xinclude always adds an <em>xml:base</em> attribute to an included element to help preserve the base uri. The problem is that my schema doesn't allow this attribute. Is there any way for me to get rid of this? I've looked around online and haven't really seen anything that can be easily implemented.</p>