# XML

CLion brings powerful support for XML that includes [structure validation](validating-web-content-files.html), [formatting](reformat-and-rearrange-code.html) (`Ctrl+Alt+L` (Windows), `⌘ ⌥ L` (macOS), `⌘ ⌥ L` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ L` (macOS System Shortcuts), `Ctrl+Alt+L` (XWin), `Ctrl+Alt+L` (GNOME), `Alt+Shift+L` (KDE), `Ctrl+Alt+L` (Emacs), `Ctrl+Alt+L` (Sublime Text), `⌘ ⌥ L` (Sublime Text (macOS)), `⌘ ⌥ L` (Xcode), `Ctrl+Alt+Enter` (Visual Studio), `⌘ ⌥ ⏎` (Visual Studio (macOS)), `Ctrl+Alt+L` (ReSharper), `⌘ ⌥ L` (ReSharper (macOS)), `Ctrl+;` (QtCreator), `⌘ ;` (QtCreator (macOS)), `Alt+Shift+F` (NetBeans), `Ctrl+Alt+L` (Eclipse), `⌘ ⇧ F` (Eclipse (macOS))) and [indentation](indentation.html) (`Ctrl+Alt+I` (Windows), `⌃ ⌥ I` (macOS), `⌘ ⌥ I` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ I` (macOS System Shortcuts), `Ctrl+Alt+I` (XWin), `Ctrl+Alt+I` (GNOME), `Ctrl+Alt+I` (KDE), `Ctrl+Alt+I` (Emacs), `Ctrl+Alt+I` (Sublime Text), `⌃ ⌥ I` (Sublime Text (macOS)), `⌃ I` (Xcode), `Ctrl+Alt+I` (Visual Studio), `⌃ ⌥ I` (Visual Studio (macOS)), `Ctrl+Alt+I` (ReSharper), `⌃ ⌥ I` (ReSharper (macOS)), `Ctrl+I` (QtCreator), `⌘ I` (QtCreator (macOS)), `Ctrl+Alt+I` (NetBeans), `Ctrl+I` (Eclipse), `⌘ I` (Eclipse (macOS)) according to the [XML code style](settings-code-style-xml.html), [importing unbound namespaces](#import-xml-namespace), [viewing code structure](null) ,    (`Ctrl+Shift+Delete` (Windows), `⌘ ⇧ ⌦` (macOS), `⌘ ⇧ ⌦` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ ⌦` (macOS System Shortcuts), `Ctrl+Shift+Delete` (XWin), `Ctrl+Shift+Delete` (GNOME), `Ctrl+Shift+Delete` (KDE), `Ctrl+Shift+Delete` (Emacs), `Ctrl+Shift+Delete` (Sublime Text), `⌘ ⇧ ⌦` (Sublime Text (macOS)), `⌘ ⇧ ⌦` (Xcode), `Ctrl+Shift+Delete` (Visual Studio), `⌘ ⇧ ⌦` (Visual Studio (macOS)), `Ctrl+Shift+Delete` (ReSharper), `⌘ ⇧ ⌦` (ReSharper (macOS)), `Ctrl+Shift+Delete` (QtCreator), `⌘ ⇧ ⌦` (QtCreator (macOS)), `Ctrl+Shift+Delete` (NetBeans), `Alt+R` (Eclipse), `Ctrl+Shift+Delete` (Eclipse (macOS))), generating [DTD files](generating-dtd.html) and [schemas from instance
documents](generating-xml-schema-from-instance-document.html), as well as syntax and error highlighting, [code completion](auto-completing-code.html) (`Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `⌃ Space` (Xcode), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (ReSharper), `⌃ Space` (ReSharper (macOS)), `Ctrl+Space` (QtCreator), `⌃ Space` (QtCreator (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS))), [intention actions](intention-actions.html) (`Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `⌥ ⏎` (Xcode), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (ReSharper), `⌥ ⏎` (ReSharper (macOS)), `Alt+Enter` (QtCreator), `⌥ ⏎` (QtCreator (macOS)), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS))),  [quick documentation look-up](viewing-inline-documentation.html) (`Ctrl+Q` (Windows), `F1` (macOS), `⌃ J` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Ctrl+Q` (XWin), `Ctrl+Q` (GNOME), `Ctrl+Q` (KDE), `Ctrl+Q` (Emacs), `Ctrl+Q` (Sublime Text), `Ctrl+Q` (Sublime Text (macOS)), `⌘ ⌃ ⇧ /` (Xcode), `Ctrl+K, I` (Visual Studio), `⌘ K, I` (Visual Studio (macOS)), `Ctrl+Q` (ReSharper), `⌃ Q` (ReSharper (macOS)), `Ctrl+Q` (QtCreator), `Ctrl+Q` (QtCreator (macOS)), `Ctrl+Q` (NetBeans), `Alt+Middle-Click` (Eclipse), `⌥ Middle-Click` (Eclipse (macOS))), and more.

CLion uses Xerces 2.11, an XML parser developed by Apache Software Foundation Group.

## Import XML namespaces

If you use a tag or an attribute from a namespace that is not bound, CLion detects the problem and shows a tooltip.

![Tooltip: Reference to an unbound namespace](https://resources.jetbrains.com/help/img/idea/2026.2/import_unbound_namespace_tooltip.png)

To solve the problem, use the quick-fix that CLion suggests.

Procedure:

* Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `⌥ ⏎` (Xcode), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (ReSharper), `⌥ ⏎` (ReSharper (macOS)), `Alt+Enter` (QtCreator), `⌥ ⏎` (QtCreator (macOS)), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)). If there are multiple choices, select the required namespace from the list.

[Video](https://resources.jetbrains.com/help/img/idea/2026.2/ws_unboundNameSpace2.mp4)

* Alternatively, hover over the problem and click Create namespace declaration in the popup that opens.   If there are multiple choices, select the required namespace from the list.

[Video](https://resources.jetbrains.com/help/img/idea/2026.2/ws_unboundNameSpace1.mp4)

## Configure syntax highlighting

You can configure XML-aware syntax highlighting according to your preferences and habits.

Procedure:

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Editor | Color Scheme | XML`.

2. Select the color scheme, accept the highlighting settings inherited from the defaults or customize them as described in [Colors and fonts](configuring-colors-and-fonts.html).

