This method of the Document class is a boolean switch that determines whether to load external DTDs or entities.
public void setLoadExternal(boolean yes);