Okay this is scary but it is just adding a configure option to disable

* HTMLtree.c SAX2.c c14n.c catalog.c configure.in debugXML.c
  encoding.c entities.c nanoftp.c nanohttp.c parser.c relaxng.c
  testAutomata.c testC14N.c testHTML.c testRegexp.c testRelax.c
  testSchemas.c testXPath.c threads.c tree.c valid.c xmlIO.c
  xmlcatalog.c xmllint.c xmlmemory.c xmlreader.c xmlschemas.c
  example/gjobread.c include/libxml/HTMLtree.h include/libxml/c14n.h
  include/libxml/catalog.h include/libxml/debugXML.h
  include/libxml/entities.h include/libxml/nanohttp.h
  include/libxml/relaxng.h include/libxml/tree.h
  include/libxml/valid.h include/libxml/xmlIO.h
  include/libxml/xmlschemas.h include/libxml/xmlversion.h.in
  include/libxml/xpathInternals.h python/libxml.c:
  Okay this is scary but it is just adding a configure option
  to disable output, this touches most of the files.
Daniel
diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h
index c40df38..832c7c8 100644
--- a/include/libxml/HTMLtree.h
+++ b/include/libxml/HTMLtree.h
@@ -68,6 +68,7 @@
 XMLPUBFUN int XMLCALL		
 		htmlSetMetaEncoding	(htmlDocPtr doc,
 					 const xmlChar *encoding);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL	    
 		htmlDocDumpMemory	(xmlDocPtr cur,
 					 xmlChar **mem,
@@ -117,16 +118,16 @@
 					 xmlDocPtr cur,
 					 const char *encoding,
 					 int format);
-
-XMLPUBFUN int XMLCALL		
-		htmlIsBooleanAttr	(const xmlChar *name);
 XMLPUBFUN void XMLCALL 
 		htmlNodeDumpOutput	(xmlOutputBufferPtr buf, 
 					 xmlDocPtr doc,
 					 xmlNodePtr cur, 
 					 const char *encoding);
 
+#endif /* LIBXML_OUTPUT_ENABLED */
 
+XMLPUBFUN int XMLCALL		
+		htmlIsBooleanAttr	(const xmlChar *name);
 
 
 #ifdef __cplusplus
diff --git a/include/libxml/c14n.h b/include/libxml/c14n.h
index a2d9aed..8a78929 100644
--- a/include/libxml/c14n.h
+++ b/include/libxml/c14n.h
@@ -11,6 +11,7 @@
  */
 #ifndef __XML_C14N_H__
 #define __XML_C14N_H__    
+#ifdef LIBXML_OUTPUT_ENABLED
 
 #ifdef __cplusplus
 extern "C" {
@@ -92,5 +93,6 @@
 }
 #endif /* __cplusplus */
 
+#endif /* LIBXML_OUTPUT_ENABLED */
 #endif /* __XML_C14N_H__ */
 
diff --git a/include/libxml/catalog.h b/include/libxml/catalog.h
index 689e7ce..c8a5ac3 100644
--- a/include/libxml/catalog.h
+++ b/include/libxml/catalog.h
@@ -91,9 +91,11 @@
 XMLPUBFUN xmlChar * XMLCALL	
 		xmlACatalogResolveURI	(xmlCatalogPtr catal,
 					 const xmlChar *URI);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		
 		xmlACatalogDump		(xmlCatalogPtr catal,
 					 FILE *out);
+#endif /* LIBXML_OUTPUT_ENABLED */
 XMLPUBFUN void XMLCALL		
 		xmlFreeCatalog		(xmlCatalogPtr catal);
 XMLPUBFUN int XMLCALL		
@@ -110,8 +112,10 @@
 		xmlLoadCatalogs		(const char *paths);
 XMLPUBFUN void XMLCALL		
 		xmlCatalogCleanup	(void);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		
 		xmlCatalogDump		(FILE *out);
+#endif /* LIBXML_OUTPUT_ENABLED */
 XMLPUBFUN xmlChar * XMLCALL	
 		xmlCatalogResolve	(const xmlChar *pubID,
 	                                 const xmlChar *sysID);
diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h
index f71e670..58211eb 100644
--- a/include/libxml/debugXML.h
+++ b/include/libxml/debugXML.h
@@ -148,6 +148,7 @@
 				 char *filename,
 				 xmlNodePtr node,
 				 xmlNodePtr node2);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN int XMLCALL	
 	xmlShellWrite		(xmlShellCtxtPtr ctxt,
 				 char *filename,
@@ -158,6 +159,7 @@
 				 char *filename,
 				 xmlNodePtr node,
 				 xmlNodePtr node2);
+#endif /* LIBXML_OUTPUT_ENABLED */
 XMLPUBFUN int XMLCALL	
 	xmlShellValidate	(xmlShellCtxtPtr ctxt,
 				 char *dtd,
diff --git a/include/libxml/entities.h b/include/libxml/entities.h
index 6355863..515913d 100644
--- a/include/libxml/entities.h
+++ b/include/libxml/entities.h
@@ -110,12 +110,14 @@
 			xmlCopyEntitiesTable	(xmlEntitiesTablePtr table);
 XMLPUBFUN void XMLCALL			
 			xmlFreeEntitiesTable	(xmlEntitiesTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL			
 			xmlDumpEntitiesTable	(xmlBufferPtr buf,
 						 xmlEntitiesTablePtr table);
 XMLPUBFUN void XMLCALL			
 			xmlDumpEntityDecl	(xmlBufferPtr buf,
 						 xmlEntityPtr ent);
+#endif /* LIBXML_OUTPUT_ENABLED */
 XMLPUBFUN void XMLCALL			
 			xmlCleanupPredefinedEntities(void);
 
diff --git a/include/libxml/nanohttp.h b/include/libxml/nanohttp.h
index 8897fda..87990aa 100644
--- a/include/libxml/nanohttp.h
+++ b/include/libxml/nanohttp.h
@@ -56,9 +56,11 @@
 	xmlNanoHTTPRead		(void *ctx,
 				 void *dest,
 				 int len);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN int XMLCALL	
 	xmlNanoHTTPSave		(void *ctxt,
 				 const char *filename);
+#endif /* LIBXML_OUTPUT_ENABLED */
 XMLPUBFUN void XMLCALL	
 	xmlNanoHTTPClose	(void *ctx);
 #ifdef __cplusplus
diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h
index 2129eea..25fea44 100644
--- a/include/libxml/relaxng.h
+++ b/include/libxml/relaxng.h
@@ -103,12 +103,14 @@
 		    xmlRelaxNGParse		(xmlRelaxNGParserCtxtPtr ctxt);
 XMLPUBFUN void XMLCALL		
 		    xmlRelaxNGFree		(xmlRelaxNGPtr schema);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		
 		    xmlRelaxNGDump		(FILE *output,
 					 xmlRelaxNGPtr schema);
 XMLPUBFUN void XMLCALL
 		    xmlRelaxNGDumpTree	(FILE * output,
 					 xmlRelaxNGPtr schema);
+#endif /* LIBXML_OUTPUT_ENABLED */
 /*
  * Interfaces for validating
  */
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 686364f..4165627 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -533,13 +533,6 @@
 /*
  * Variables.
  */
-#if 0
-LIBXML_DLL_IMPORT extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */
-LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput;  /* try to indent the tree dumps */
-LIBXML_DLL_IMPORT extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */
-LIBXML_DLL_IMPORT extern int xmlSaveNoEmptyTags; /* save empty tags as <empty></empty> */
-LIBXML_DLL_IMPORT extern int xmlDefaultBufferSize; /* default buffer size */
-#endif
 
 /*
  * Some helper functions
@@ -961,6 +954,7 @@
 		xmlReconciliateNs	(xmlDocPtr doc,
 					 xmlNodePtr tree);
 
+#ifdef LIBXML_OUTPUT_ENABLED
 /*
  * Saving.
  */
@@ -1037,6 +1031,7 @@
 					 xmlDocPtr cur,
 					 const char *encoding);
 
+#endif /* LIBXML_OUTPUT_ENABLED */
 /*
  * XHTML
  */
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index 46b36da..cb7ff2c 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -145,12 +145,14 @@
 		xmlCopyNotationTable	(xmlNotationTablePtr table);
 XMLPUBFUN void XMLCALL		    
 		xmlFreeNotationTable	(xmlNotationTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		    
 		xmlDumpNotationDecl	(xmlBufferPtr buf,
 					 xmlNotationPtr nota);
 XMLPUBFUN void XMLCALL		    
 		xmlDumpNotationTable	(xmlBufferPtr buf,
 					 xmlNotationTablePtr table);
+#endif /* LIBXML_OUTPUT_ENABLED */
 
 /* Element Content */
 XMLPUBFUN xmlElementContentPtr XMLCALL 
@@ -183,12 +185,14 @@
 		xmlCopyElementTable	(xmlElementTablePtr table);
 XMLPUBFUN void XMLCALL		   
 		xmlFreeElementTable	(xmlElementTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		   
 		xmlDumpElementTable	(xmlBufferPtr buf,
 					 xmlElementTablePtr table);
 XMLPUBFUN void XMLCALL		   
 		xmlDumpElementDecl	(xmlBufferPtr buf,
 					 xmlElementPtr elem);
+#endif /* LIBXML_OUTPUT_ENABLED */
 
 /* Enumeration */
 XMLPUBFUN xmlEnumerationPtr XMLCALL 
@@ -213,12 +217,14 @@
 		xmlCopyAttributeTable  (xmlAttributeTablePtr table);
 XMLPUBFUN void XMLCALL		     
 		xmlFreeAttributeTable  (xmlAttributeTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		     
 		xmlDumpAttributeTable  (xmlBufferPtr buf,
 					xmlAttributeTablePtr table);
 XMLPUBFUN void XMLCALL		     
 		xmlDumpAttributeDecl   (xmlBufferPtr buf,
 					xmlAttributePtr attr);
+#endif /* LIBXML_OUTPUT_ENABLED */
 
 /* IDs */
 XMLPUBFUN xmlIDPtr XMLCALL	
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index 244c950..a212f8e 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -62,6 +62,7 @@
  */
 typedef int (*xmlInputCloseCallback) (void * context);
 
+#ifdef LIBXML_OUTPUT_ENABLED
 /*
  * Those are the functions and datatypes for the library output
  * I/O structures.
@@ -107,6 +108,7 @@
  * Returns 0 or -1 in case of error
  */
 typedef int (*xmlOutputCloseCallback) (void * context);
+#endif /* LIBXML_OUTPUT_ENABLED */
 
 #ifdef __cplusplus
 }
@@ -133,6 +135,7 @@
 };
 
 
+#ifdef LIBXML_OUTPUT_ENABLED
 struct _xmlOutputBuffer {
     void*                   context;
     xmlOutputWriteCallback  writecallback;
@@ -144,14 +147,13 @@
     xmlBufferPtr conv;      /* if encoder != NULL buffer for output */
     int written;            /* total number of byte written */
 };
+#endif /* LIBXML_OUTPUT_ENABLED */
 
 /*
  * Interfaces for input
  */
 XMLPUBFUN void XMLCALL	
 	xmlCleanupInputCallbacks		(void);
-XMLPUBFUN void XMLCALL	
-	xmlCleanupOutputCallbacks		(void);
 
 XMLPUBFUN void XMLCALL	
 	xmlRegisterDefaultInputCallbacks	(void);
@@ -198,10 +200,13 @@
 						 xmlInputOpenCallback openFunc,
 						 xmlInputReadCallback readFunc,
 						 xmlInputCloseCallback closeFunc);
+#ifdef LIBXML_OUTPUT_ENABLED
 /*
  * Interfaces for output
  */
 XMLPUBFUN void XMLCALL	
+	xmlCleanupOutputCallbacks		(void);
+XMLPUBFUN void XMLCALL	
 	xmlRegisterDefaultOutputCallbacks(void);
 XMLPUBFUN xmlOutputBufferPtr XMLCALL
 	xmlAllocOutputBuffer		(xmlCharEncodingHandlerPtr encoder);
@@ -243,6 +248,7 @@
 					 xmlOutputOpenCallback openFunc,
 					 xmlOutputWriteCallback writeFunc,
 					 xmlOutputCloseCallback closeFunc);
+#endif /* LIBXML_OUTPUT_ENABLED */
 
 /*  This function only exists if HTTP support built into the library  */
 #ifdef LIBXML_HTTP_ENABLED
diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h
index 1175144..0e563f4 100644
--- a/include/libxml/xmlschemas.h
+++ b/include/libxml/xmlschemas.h
@@ -88,9 +88,11 @@
 	    xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt);
 XMLPUBFUN void XMLCALL		
 	    xmlSchemaFree		(xmlSchemaPtr schema);
+#ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN void XMLCALL		
 	    xmlSchemaDump		(FILE *output,
 					 xmlSchemaPtr schema);
+#endif /* LIBXML_OUTPUT_ENABLED */
 /*
  * Interfaces for validating
  */
diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
index ef1a335..61b45ca 100644
--- a/include/libxml/xmlversion.h.in
+++ b/include/libxml/xmlversion.h.in
@@ -84,6 +84,15 @@
 #endif
 
 /**
+ * LIBXML_OUTPUT_ENABLED:
+ *
+ * Whether the serialization/saving support is configured in
+ */
+#if @WITH_OUTPUT@
+#define LIBXML_OUTPUT_ENABLED
+#endif
+
+/**
  * LIBXML_FTP_ENABLED:
  *
  * Whether the FTP support is configured in
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h
index d74b9dd..6b9e996 100644
--- a/include/libxml/xpathInternals.h
+++ b/include/libxml/xpathInternals.h
@@ -377,6 +377,7 @@
 				 int line,
 				 int no);
 
+#ifdef LIBXML_DEBUG_ENABLED
 XMLPUBFUN void XMLCALL		
 		xmlXPathDebugDumpObject	(FILE *output,
 					 xmlXPathObjectPtr cur,
@@ -385,7 +386,7 @@
 	    xmlXPathDebugDumpCompExpr(FILE *output,
 					 xmlXPathCompExprPtr comp,
 					 int depth);
-
+#endif
 /**
  * NodeSet handling.
  */