title: Formatting text output of html with jSoup
body: <p>I have a document I want to parse it contains html, I want to convert if from <code>html</code> to <code>plaintext</code> but with formatting.</p>
  
  <p>Example extract</p>
  
  <pre><code>&lt;p&gt;My simple paragragh&lt;/p&gt;
  &lt;p&gt;My paragragh with &lt;a&gt;Link&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;My paragragh with an &lt;img/&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I can do the simple example quite easily by doing (maybe not efficently)</p>
  
  <pre><code>StringBuilder sb = new StringBuilder();
  
  for(Element element : doc.getAllElements()){
      if(element.tag().getName().equals("p")){
          sb.append(element.text());
          sb.append("\n\n");
      }
  }
  </code></pre>
  
  <p>Is it possible (and how would I do it) to insert output for an inline element in the correct place. An example:</p>
  
  <pre><code>&lt;p&gt;My paragragh with &lt;a&gt;Link&lt;/a&gt; in the middle&lt;/p&gt; 
  </code></pre>
  
  <p>would become:</p>
  
  <pre><code>My paragragh with (Location: http://mylink.com) in the middle
  </code></pre>