@Override
    public String format(String content, boolean isLineStart, String indentation, int[] positions) {
        if (CommonUtils.isEmpty(content)) {
            return content;
        }
        try {
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            transformerFactory.setAttribute("indent-number", 2);
            Transformer transformer = transformerFactory.newTransformer();
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            if (!content.contains("<?xml")) {
                transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            }

            SAXParserFactory spf = SAXParserFactory.newInstance();
            spf.setNamespaceAware(true);
            spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
            Source src = new SAXSource(spf.newSAXParser().getXMLReader(), new InputSource(new StringReader(content)));

            StreamResult result = new StreamResult(new StringWriter());
            transformer.transform(src, result);
            String resultString = result.getWriter().toString();
            if (CommonUtils.isEmpty(resultString)) {
                return content;
            }

            return resultString.replaceAll("(?m)^[ \\t]*\\r?\\n", ""); // Replace all empty lines
        } catch (Throwable e) {
            log.debug("Error formatting XML: " + e.getMessage());
            return content;
        }
    }
The formatting strategy that transforms SQL keywords to upper case
plugins/org.jkiss.dbeaver.ui.editors.xml/src/org/jkiss/dbeaver/ui/editors/xml/XMLFormattingStrategy.java