title: "Error attempting to parse XML file" when parsing using XInclude
body: <p>I am trying to create a combined xml document using XInclude to be unmarshalled via JAXB. </p>
  
  <p>Here is my unmarshalling code:</p>
  
  <pre class="lang-java prettyprint-override"><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 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>Here is my main xml file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;tag1  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:xi="http://www.w3.org/2001/XInclude"
                  xsi:schemaLocation="path-to-schema/schema.xsd"&gt;
  
      &lt;xi:include href="path-to-xml-files/included.xml"&gt;&lt;/xi:include&gt;
  &lt;/tag1&gt;
  </code></pre>
  
  <p>And included.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;tag2&gt; Some text &lt;/tag2&gt;
  </code></pre>
  
  <p>In order to actually unmarshal it, I create a new <code>FileReader</code> with the path to my xml file (path-to-xml-files/main.xml - the path is correct because it can clearly find the main file). When I run it, however, there is something wrong with the included file. I am getting an UnmarshalException with a linked SAXParseException with this error message: <b>Error attempting to parse XML file (href='path-to-xml-files/included.xml'). </b></p>
  
  <p>When I manually merge the content of included.xml into main.xml, it runs with no problems.</p>
  
  <p>I can't tell if it's a JAXB issue or an XInclude issue, though I strongly suspect the latter.</p>
  
  <p>What am I missing?</p>