Visual Studio 2008's XAML editor (SP1) cannot reformat the XML into a consistent style.

Which tools can I use to get a nicely formatted XAML file? Studio integration preferred.

+1  A: 

The only tool I found is Kaxaml, which does nice formatting ("XAML Scrubber" entry in the left menu), but being a stand-alone editor doesn't quite make the cut.

David Schmitt
+2  A: 

Have you tried CTRL K, D?

VS 2008's XAML Editor doesn't recognize that as a chord.
David Schmitt
VS2010 done - it's actually CTRL-K,CTRL-D (Edit.FormatDocument is what it equates to)And works quite nicely at first glance
+2  A: 

While browsing through the options, I found that I had to set "Position each attribute on a separate line" and "Position first attribute on same line as start tag" under "Tools > Options ... > Text-Editor > XAML > Formatting > Spacing" and reset the Keyboard mappings under "Tools > Options ... > Environment > Keyboard" to "Visual C# 2005".

Now the XAML editor reformats the XAML to my taste when pressing Ctrl+E, D.

David Schmitt
+1  A: is a nice plugin for formatting your xaml so the attributes line up underneath each other.

That just does what the VS2008 editor can do himself, if the options are set right.
David Schmitt
+3  A: 

Here's a link that is specific to VS2008 XAML formatting but the good news is you can do it directly inside VS.

thanks, I found that already. It's good enough for me!
David Schmitt
+2  A: 

Karl just released v2 of his XAML Power toys and it can reformat your xaml from VS2008! Check out the video about XAML Power Toys Accessories

+1  A: 

Or try xaml styler hosted at for visual studio 2010. If you ever used Kaxaml's Xaml Scrubber and you like it, then you could think of this extension is the "Xaml Scrubber" for Visual Studio.

Check for feature highlights.