/** * Returns the specified exception as XML * * @param ex The exception to turn to XML. * @param xml The XML writer. * @param wrap Whether to wrap the XML into an element. * * @throws IOException Only if thrown by the XML writer. */ private static void asSAXParseExceptionXML(SAXParseException ex, XMLWriter xml, boolean wrap) throws IOException { if (wrap) { xml.openElement("exception"); } xml.attribute("type", "SAXParseException"); asExceptionXML(ex, xml, false); // Add the locator toXML(toLocator(ex), xml); if (wrap) { xml.closeElement(); } }