 @@ -469,6 +483,11 @@
  		public Node* prev;
  		public Doc* doc;
-
+ 
 +		public HashTable notations;
 +		public HashTable elements;
 +		public HashTable attributes;

+		public int save_doc (Xml.Doc *doc);
+		[CCode (cname = "xmlSaveTree")]
+		public int save_tree (Xml.Node *node);
+
+	}
+
+	[Compact]
 	[CCode (cname = "xmlParserCtxt")]
 	public class ParserCtxt {
 		public SAXHandler* sax;
@@ -887,7 +923,7 @@
 	public delegate void* OutputOpenCallback (string filename);

 	[CCode (has_target = false, cname = "xmlOutputWriteCallback", cheader_filename = "libxml/xmlIO.h")]
-	public delegate int OutputWriteCallback ([CCode (array_length = false)] char[] buffer, int len);
+	public delegate int OutputWriteCallback (void* context, [CCode (array_length = false)] char[] buffer, int len);

 	[CCode (has_target = false, cname = "xmlOutputCloseCallback", cheader_filename = "libxml/xmlIO.h")]
 	public delegate int OutputCloseCallback (void * context);

+
 		public weak string external_id;
 		public weak string system_id;
 
@@ -790,6 +809,36 @@
 	}
 
 	[Compact]
+	[CCode (cname = "xmlBuffer", free_function = "xmlBufferFree", cheader_filename = "libxml/tree.h")]
+	public class Buffer {
+		[CCode (cname = "xmlBufferCreate")]
+		public Buffer ();
+
+		[CCode (cname = "xmlBufferContent")]
+		public string content ();
+
+		[CCode (cname = "xmlNodeDump")]
+		public int node_dump (Xml.Doc *doc, Xml.Node *cur, int level, int format);
+	}
+
+	[Compact]
+	[CCode (cname = "xmlSaveCtxt", free_function = "xmlSaveClose", cheader_filename = "libxml/xmlsave.h")]
+	public class SaveCtxt {
+		[CCode (cname = "xmlSaveToIO")] // , instance_pos = -1)]
