Since .xsd is and XML itself you need to change the XML formatting settitngs.
In IDEA settings (File -> Settings... or Ctrl+Alt+S) go to Editor -> Code Style -> XML and in Wrap Attributes dropdown choose Do Not Wrap.

Videos
Go to File -> Settings -> Editor -> Code Style -> XML
Change the Scheme there to Default. Normally it doesn't restrict on what you are trying to do, unnless there is any defined settings.

On Android Studio 4.0.1:
Go to Settings (or Preferences on MaxOS) -> Editor -> Code Style -> XML -> "Other" Tab.
Check Keep line breaks.
Sure there is. This is all you need to do:
- Go to
File -> Settings -> Global Code Style -> General
- Disable the checkbox next to 'Use same settings for all file types'
- The 'XML' tab should become enabled. Click it and set the 'tab' (and probably 'indent') size to 2.
In IntelliJ IDEA 10.0.3 it's File > Settings > Code Style > General
If your XML is previously exported Intellij you can simply do:
File > Import Settings > select your xml
If its custom defined, one you can try copying your xml to intellij config directory:
config/codestyles
Assuming your xml is in format intellij can understand, it will then show up in
Code Styles > Manage
If your XML is in different format, try to match tags with one of pre-defined styles(also XML)
For users coming here for the same issue but recent IntelliJ version (like 20), it is a bit different now. Once you've exported your formatter in XML, then follow these steps:
- Go to Preferences
- Select Editor
- Sele Code Style
- Select the language of your choice (eg Java)
- Go to Scheme at the top, click on the setting button by the side
- Select the option to import scheme, choose your formatter type and select the xml file. Then save and apply.

If you see error "IntelliJ IDEA code style XML import failed with error message: null", check to ensure your XML file has the file definition <?xml version="1.0" encoding="UTF-8"?> at the top.
NOTE: This is for MacBook. I believe the difference won't be much in other platforms.
Hey everyone! Quick question: Is there a way in IntelliJ to automatically open JSON and XML files already properly formatted? I find myself reformatting every time I open a JSON file (by pressing Ctrl+Alt+L), which gets tiring. If anyone knows a setting or plugin to streamline this, please share! Thanks so much!
In IDEA 13 you could use new Formatter Control feature to disable autoformat of selected lines of code. To enable this feature you should mark the following checkbox in the project settings:

Then insert selected markers in the comments to demarcate pieces of code that should not be formatted by Reformat Code tool, something like:
<root>
<!-- @formatter:off -->
<mixed>
Some text with <inline>inline elements</inline>
and a line break.
</mixed>
<!-- @formatter:on -->
<mixed>
Some text with
<inline>inline elements</inline>
and a line break.
</mixed>
</root>
Unfortunately, there is no such feature in previous versions of IDEA and in that case the only known to me option is to format your code manually and not to use Reformat Code tool.
After trying many things, I'm getting the impression that this will not be possible. I've submitted a feature request:
http://youtrack.jetbrains.com/issue/IDEA-119650