'XML autoformat in Visual Studio Code

Is there a way to make Visual Studio Code automatically format the content of XML tags?

I want to have an indent when pressing Enter or even when closing a tag:

Not as

The wrong way

but this way:

The right way



Solution 1:[1]

The XML extension, from Red Hat, supports auto-indentation on enter, among many useful other features (like validation, code completion, autoclose tag...):

auto-indent-on-enter

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fred Bricon