Index: src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
===================================================================
--- src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java	(revision 701250)
+++ src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java	(working copy)
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.util.Locale;
@@ -34,7 +35,6 @@
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.util.DoxiaUtils;
 import org.apache.maven.doxia.util.HtmlTools;
-import org.apache.maven.doxia.util.LineBreaker;
 
 import org.codehaus.plexus.util.FileUtils;
 
@@ -61,7 +61,7 @@
     public static final String DEFAULT_SGML_SYSTEM_ID = "http://www.oasis-open.org/docbook/sgml/4.4/docbookx.dtd";
 
     /** The output writer. */
-    private LineBreaker out;
+    private PrintWriter out;
 
     /** xmlMode. */
     private boolean xmlMode = false;
@@ -127,22 +127,26 @@
     private boolean tableHasCaption;
 
     /** Used for table rows. */
-    private LineBreaker savedOut;
+    private PrintWriter savedOut;
 
     /** tableRows. */
     private String tableRows;
 
+    /** tableRows writer. */
+    private StringWriter tableRowsWriter;
+
     /** tableHasGrid. */
     private boolean tableHasGrid;
 
     private boolean skip;
 
+
     /**
      * @param writer the default writer.
      */
     public DocBookSink( Writer writer )
     {
-        this.out = new LineBreaker( writer );
+        this.out = new PrintWriter( writer );
         setItalicElement( "<emphasis>" );
         setBoldElement( "<emphasis role=\"bold\">" );
         setMonospacedElement( "<literal>" );
@@ -535,11 +539,11 @@
                 markup( " encoding=\"" + encoding + "\"" );
             }
 
-            markup( " ?>" + EOL );
+            markup( " ?>" );
 
             if ( styleSheet != null )
             {
-                markup( "<?xml-stylesheet type=\"text/css\"" + EOL + "href=\"" + styleSheet + "\" ?>" + EOL );
+                markup( "<?xml-stylesheet type=\"text/css\" href=\"" + styleSheet + "\" ?>" );
             }
         }
 
@@ -574,7 +578,7 @@
                 sysId = DEFAULT_SGML_SYSTEM_ID;
             }
         }
-        markup( EOL + "\"" + sysId + "\">" + EOL );
+        markup( " \"" + sysId + "\">" );
 
         MutableAttributeSet att = new SimpleAttributeSet();
         if ( lang != null )
@@ -594,7 +598,6 @@
         if ( hasTitle )
         {
             writeEndTag( ARTICLEINFO_TAG );
-            writeEOL();
             hasTitle = false;
         }
     }
@@ -620,7 +623,6 @@
     public void title_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -642,7 +644,6 @@
     public void author_()
     {
         writeEndTag( CORPAUTHOR_TAG );
-        writeEOL();
         authorDateFlag = false;
     }
 
@@ -665,7 +666,6 @@
     public void date_()
     {
         writeEndTag( DATE_TAG );
-        writeEOL();
         authorDateFlag = false;
     }
 
@@ -677,7 +677,6 @@
     public void body_()
     {
         writeEndTag( ARTICLE_TAG );
-        writeEOL();
         out.flush();
         resetState();
     }
@@ -700,7 +699,6 @@
     public void section1_()
     {
         writeEndTag( SECTION_TAG );
-        writeEOL();
     }
 
     /**
@@ -721,7 +719,6 @@
     public void section2_()
     {
         writeEndTag( SECTION_TAG );
-        writeEOL();
     }
 
     /**
@@ -742,7 +739,6 @@
     public void section3_()
     {
         writeEndTag( SECTION_TAG );
-        writeEOL();
     }
 
     /**
@@ -763,7 +759,6 @@
     public void section4_()
     {
         writeEndTag( SECTION_TAG );
-        writeEOL();
     }
 
     /**
@@ -784,7 +779,6 @@
     public void section5_()
     {
         writeEndTag( SECTION_TAG );
-        writeEOL();
     }
 
     /**
@@ -805,7 +799,6 @@
     public void sectionTitle_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -826,7 +819,6 @@
     public void sectionTitle1_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -847,7 +839,6 @@
     public void sectionTitle2_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -868,7 +859,6 @@
     public void sectionTitle3_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -889,7 +879,6 @@
     public void sectionTitle4_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -910,7 +899,6 @@
     public void sectionTitle5_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -931,7 +919,6 @@
     public void list_()
     {
         writeEndTag( ITEMIZEDLIST_TAG );
-        writeEOL();
     }
 
     /**
@@ -952,7 +939,6 @@
     public void listItem_()
     {
         writeEndTag( LISTITEM_TAG );
-        writeEOL();
     }
 
     /**
@@ -997,7 +983,6 @@
     public void numberedList_()
     {
         writeEndTag( ORDEREDLIST_TAG );
-        writeEOL();
     }
 
     /**
@@ -1018,7 +1003,6 @@
     public void numberedListItem_()
     {
         writeEndTag( LISTITEM_TAG );
-        writeEOL();
     }
 
     /**
@@ -1039,7 +1023,6 @@
     public void definitionList_()
     {
         writeEndTag( VARIABLELIST_TAG );
-        writeEOL();
     }
 
     /**
@@ -1060,7 +1043,6 @@
     public void definitionListItem_()
     {
         writeEndTag( VARLISTENTRY_TAG );
-        writeEOL();
     }
 
     /**
@@ -1081,7 +1063,6 @@
     public void definedTerm_()
     {
         writeEndTag( TERM_TAG );
-        writeEOL();
     }
 
     /**
@@ -1102,7 +1083,6 @@
     public void definition_()
     {
         writeEndTag( LISTITEM_TAG );
-        writeEOL();
     }
 
     /**
@@ -1123,7 +1103,6 @@
     public void paragraph_()
     {
         writeEndTag( PARA_TAG );
-        writeEOL();
     }
 
     /**
@@ -1145,20 +1124,19 @@
     public void verbatim_()
     {
         writeEndTag( PROGRAMLISTING_TAG );
-        writeEOL();
         verbatimFlag = false;
     }
 
     /** {@inheritDoc} */
     public void horizontalRule()
     {
-        markup( horizontalRuleElement + EOL );
+        markup( horizontalRuleElement );
     }
 
     /** {@inheritDoc} */
     public void pageBreak()
     {
-        markup( pageBreakElement + EOL );
+        markup( pageBreakElement );
     }
 
     /** {@inheritDoc} */
@@ -1204,7 +1182,6 @@
 
             writeEndTag( IMAGEOBJECT_TAG );
             writeEndTag( MEDIAOBJECT_TAG );
-            writeEOL();
             graphicsFileName = null;
         }
     }
@@ -1239,7 +1216,6 @@
         writeEndTag( Tag.TITLE );
         graphicElement();
         writeEndTag( FIGURE_TAG );
-        writeEOL();
     }
 
     /** {@inheritDoc} */
@@ -1264,9 +1240,8 @@
             tableHasCaption = false;
             // Formal table+title already written to original destination ---
 
-            out.write( tableRows, /*preserveSpace*/ true );
+            out.write( tableRows  );
             writeEndTag( Tag.TABLE );
-            writeEOL();
         }
         else
         {
@@ -1290,10 +1265,9 @@
 
             writeStartTag( INFORMALTABLE_TAG, att );
 
-            out.write( tableRows, /*preserveSpace*/ true );
+            out.write( tableRows  );
 
             writeEndTag( INFORMALTABLE_TAG );
-            writeEOL();
         }
 
         tableRows = null;
@@ -1314,7 +1288,8 @@
         // Divert output to a string ---
         out.flush();
         savedOut = out;
-        out = new LineBreaker( new StringWriter() );
+        tableRowsWriter = new StringWriter();
+        out = new PrintWriter( tableRowsWriter );
 
         MutableAttributeSet att = new SimpleAttributeSet();
         att.addAttribute( COLS_ATTRIBUTE, String.valueOf( justification.length ) );
@@ -1350,7 +1325,6 @@
             {
                 writeStartTag( COLSPEC_TAG, att );
                 writeEndTag( COLSPEC_TAG );
-                writeEOL();
             }
         }
 
@@ -1367,11 +1341,16 @@
     {
         writeEndTag( TBODY_TAG );
         writeEndTag( TGROUP_TAG );
-        writeEOL();
 
         // Remember diverted output and restore original destination ---
         out.flush();
-        tableRows = ( (StringWriter) out.getDestination() ).toString();
+        if ( tableRowsWriter == null )
+        {
+            throw new IllegalArgumentException( "tableRows( int[] justification, boolean grid ) was not called before." );
+        }
+
+        tableRows = tableRowsWriter.toString();
+        tableRowsWriter = null;
         out = savedOut;
     }
 
@@ -1393,7 +1372,6 @@
     public void tableRow_()
     {
         writeEndTag( ROW_TAG );
-        writeEOL();
     }
 
     /**
@@ -1414,7 +1392,6 @@
     public void tableCell_()
     {
         writeEndTag( ENTRY_TAG );
-        writeEOL();
     }
 
     /**
@@ -1433,7 +1410,6 @@
     public void tableHeaderCell_()
     {
         writeEndTag( ENTRY_TAG );
-        writeEOL();
     }
 
     /**
@@ -1479,7 +1455,6 @@
     public void tableCaption_()
     {
         writeEndTag( Tag.TITLE );
-        writeEOL();
     }
 
     /**
@@ -1634,7 +1609,7 @@
     /** {@inheritDoc} */
     public void lineBreak()
     {
-        markup( lineBreakElement + EOL );
+        markup( lineBreakElement );
     }
 
     /** {@inheritDoc} */
@@ -1695,7 +1670,7 @@
     {
         if ( !skip )
         {
-            out.write( text, /*preserveSpace*/ true );
+            out.write( text );
         }
     }
 
@@ -1708,7 +1683,7 @@
     {
         if ( !skip )
         {
-            out.write( escapeSGML( text, xmlMode ), /*preserveSpace*/ false );
+            out.write( escapeSGML( text, xmlMode ) );
         }
     }
 
@@ -1721,7 +1696,7 @@
     {
         if ( !skip )
         {
-            out.write( escapeSGML( text, xmlMode ), /*preserveSpace*/ true );
+            out.write( escapeSGML( text, xmlMode ) );
         }
     }
 
Index: src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java
===================================================================
--- src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java	(revision 701250)
+++ src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java	(working copy)
@@ -45,89 +45,89 @@
     /** {@inheritDoc} */
     protected String getTitleBlock( String title )
     {
-        return "<articleinfo><title>" + title + "</title>" + EOL;
+        return "<articleinfo><title>" + title + "</title>";
     }
 
     /** {@inheritDoc} */
     protected String getAuthorBlock( String author )
     {
-        return "<corpauthor>" + author + "</corpauthor>" + EOL;
+        return "<corpauthor>" + author + "</corpauthor>";
     }
 
     /** {@inheritDoc} */
     protected String getDateBlock( String date )
     {
-        return "<date>" + date + "</date>" + EOL;
+        return "<date>" + date + "</date>";
     }
 
     /** {@inheritDoc} */
     protected String getHeadBlock()
     {
-        return "<!DOCTYPE article PUBLIC \"" + DocBookSink.DEFAULT_SGML_PUBLIC_ID + "\""
-            + EOL + "\"" + DocBookSink.DEFAULT_SGML_SYSTEM_ID + "\">" + EOL + "<article>";
+        return "<!DOCTYPE article PUBLIC \"" + DocBookSink.DEFAULT_SGML_PUBLIC_ID + "\" "
+            + "\"" + DocBookSink.DEFAULT_SGML_SYSTEM_ID + "\"><article>";
     }
 
     /** {@inheritDoc} */
     protected String getBodyBlock()
     {
-        return "</article>" + EOL;
+        return "</article>";
     }
 
     /** {@inheritDoc} */
     protected String getSectionTitleBlock( String title )
     {
-        return "<title>" + title + "</title>" + EOL;
+        return "<title>" + title + "</title>";
     }
 
     /** {@inheritDoc} */
     protected String getSection1Block( String title )
     {
-        return "<section><title>" + title + "</title>" + EOL + "</section>" + EOL;
+        return "<section><title>" + title + "</title>" + "</section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection2Block( String title )
     {
-        return "<section><title>" + title + "</title>" + EOL + "</section>" + EOL;
+        return "<section><title>" + title + "</title>" + "</section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection3Block( String title )
     {
-        return "<section><title>" + title + "</title>" + EOL + "</section>" + EOL;
+        return "<section><title>" + title + "</title>" + "</section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection4Block( String title )
     {
-        return "<section><title>" + title + "</title>" + EOL + "</section>" + EOL;
+        return "<section><title>" + title + "</title>" + "</section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection5Block( String title )
     {
-        return "<section><title>" + title + "</title>" + EOL + "</section>" + EOL;
+        return "<section><title>" + title + "</title>" + "</section>";
     }
 
     /** {@inheritDoc} */
     protected String getListBlock( String item )
     {
-        return "<itemizedlist><listitem>" + item  + "</listitem>" + EOL + "</itemizedlist>" + EOL;
+        return "<itemizedlist><listitem>" + item  + "</listitem>" + "</itemizedlist>";
     }
 
     /** {@inheritDoc} */
     protected String getNumberedListBlock( String item )
     {
         return "<orderedlist numeration=\"lowerroman\"><listitem>"
-            + item  + "</listitem>" + EOL + "</orderedlist>" + EOL;
+            + item  + "</listitem>" + "</orderedlist>";
     }
 
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
         return "<variablelist><varlistentry><term>" + definum
-            + "</term>" + EOL + "<listitem>" + definition
-            + "</listitem>" + EOL + "</varlistentry>" + EOL + "</variablelist>" + EOL;
+            + "</term>" + "<listitem>" + definition
+            + "</listitem>" + "</varlistentry>" + "</variablelist>";
     }
 
     /** {@inheritDoc} */
@@ -136,39 +136,39 @@
         // TODO: fix source
         return "<figure><title>" + caption
             + "</title><mediaobject><imageobject><imagedata fileref=\"figure.jpg.jpeg\" format=\"JPEG\"></imagedata></imageobject></mediaobject>"
-            + EOL + "</figure>" + EOL;
+            + "</figure>";
     }
 
     /** {@inheritDoc} */
     protected String getTableBlock( String cell, String caption )
     {
         return "<table frame=\"none\" rowsep=\"0\" colsep=\"0\"><title>" + caption
-            + "</title>" + EOL + "<tgroup cols=\"1\"><colspec align=\"center\"></colspec>" + EOL + "<tbody><row><entry>"
-            + cell  + "</entry>" + EOL + "</row>" + EOL + "</tbody></tgroup>" + EOL + "</table>" + EOL;
+            + "</title>" + "<tgroup cols=\"1\"><colspec align=\"center\"></colspec>" + "<tbody><row><entry>"
+            + cell  + "</entry>" + "</row>" + "</tbody></tgroup>" + "</table>";
     }
 
     /** {@inheritDoc} */
     protected String getParagraphBlock( String text )
     {
-        return "<para>" + text + "</para>" + EOL;
+        return "<para>" + text + "</para>";
     }
 
     /** {@inheritDoc} */
     protected String getVerbatimBlock( String text )
     {
-        return "<programlisting>" + text + "</programlisting>" + EOL;
+        return "<programlisting>" + text + "</programlisting>";
     }
 
     /** {@inheritDoc} */
     protected String getHorizontalRuleBlock()
     {
-        return "<!-- HR -->" + EOL;
+        return "<!-- HR -->";
     }
 
     /** {@inheritDoc} */
     protected String getPageBreakBlock()
     {
-        return "<!-- PB -->" + EOL;
+        return "<!-- PB -->";
     }
 
     /** {@inheritDoc} */
@@ -204,7 +204,7 @@
     /** {@inheritDoc} */
     protected String getLineBreakBlock()
     {
-        return "<!-- LB -->" + EOL;
+        return "<!-- LB -->";
     }
 
     /** {@inheritDoc} */

