protected static boolean setSupportDTD(XMLInputFactory f, boolean state)
     throws XMLStreamException {
   try {
     f.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.valueOf(state));
     return (willSupportDTD(f) == state);
   } catch (IllegalArgumentException e) {
     // Let's assume that the property (or specific value) is NOT supported...
     return false;
   }
 }
 protected static void setRepairing(XMLOutputFactory f, boolean state) {
   f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.valueOf(state));
 }
 protected static void setValidating(XMLInputFactory f, boolean state) throws XMLStreamException {
   f.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.valueOf(state));
 }
 protected static void setCoalescing(XMLInputFactory f, boolean state) throws XMLStreamException {
   f.setProperty(XMLInputFactory.IS_COALESCING, Boolean.valueOf(state));
 }