</BUG>
}
public Document build(Reader reader) throws XMLStreamException {
isReadingMidStream = false;
<BUG>return buildInternal(xifactory.createXMLStreamReader(reader));
</BUG>
}
private Document buildInternal(XMLStreamReader r) throws XMLStreamException {
JDOMFactory f = factory;
if (f == null) {

isReadingMidStream = true;
return buildInternal(r);
}
public Document build(InputStream is) throws XMLStreamException {
isReadingMidStream = false;
return buildInternal(StaxUtils.createXMLStreamReader(is));
}
public Document build(Reader reader) throws XMLStreamException {
isReadingMidStream = false;
return buildInternal(StaxUtils.createXMLStreamReader(reader));
}
private Document buildInternal(XMLStreamReader r) throws XMLStreamException {
JDOMFactory f = factory;
if (f == null) {
