title: Eclipse Plug-in use standard Format function in the code
body: <p>I'm working on a plugin for Eclipse and I created a StructuredTextEditor. The editor contains an XML. And I want to align the code nicely (like indent etc.). I search a possibility to apply the standard function "Format" of Eclipse <KBD>SHIFT</KBD>+<KBD>Ctrl</KBD>+<KBD>F</KBD>.
  I found a code snippet that does exaclty this but I didn't get it to work:</p>
  
  <pre><code>    String commandId = IJavaEditorActionDefinitionIds.FORMAT;
      IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
      try {
          handlerService.executeCommand(commandId, null);
      } catch (Exception e1) {
          e1.printStackTrace();
      } 
  </code></pre>
  
  <p>I always get the following Exception:</p>
  
  <pre><code>org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.jdt.ui.edit.text.java.format
  </code></pre>
  
  <p>Does anyone can help me get running this code, or got en other solution to <strong>format the xml content</strong>, its important to use the same format like the eclipse formatter uses.</p>