     "The XML module attempts to implement the XML 1.1 standard, converting strings of text into XML and vice versa. It currently is a work in progress."
     $nl
     "The XML module was implemented by Daniel Ehrenberg, with contributions from the Factor community"
-    { $subsection { "xml" "basic" } }
+    { $subsection { "xml" "reading" } }
+    { $subsection { "xml" "writing" } }
     { $subsection { "xml" "classes" } }
     { $subsection { "xml" "construct" } }
     { $subsection { "xml" "utils" } }

{ $description "calls the given quotation using HTML entity values" }
{ $see-also html-entities with-entities } ;

HELP: file>xml
{ $values { "filename" "a string representing a filename" }
    { "xml" "an XML document" } }
{ $description "opens the given file, reads it in as XML, closes the file and returns the corresponding XML tree" }
{ $see-also string>xml read-xml } ;

ARTICLE: { "xml" "basic" } "Basic words for XML processing"
    "These are the most basic words needed for processing an XML document"
    $nl
    "Parsing XML:"
    { $subsection string>xml }
    { $subsection read-xml }
    { $subsection xml-chunk }
    { $subsection file>xml }
    "Printing XML"
    { $subsection xml>string }
    { $subsection write-xml }
    { $subsection write-item }
    { $subsection write-chunk }
    "Other"
    { $subsection xml-reprint } ;

ARTICLE: { "xml" "classes" } "XML data classes"

HELP: string>xml
{ $values { "string" "a string" } { "xml" "an xml document" } }
{ $description "converts a string into an " { $link xml }
    " datatype for further processing" } ;

HELP: read-xml
{ $values { "stream" "a stream that supports readln" }
    { "xml" "an XML document" } }
{ $description "exausts the given stream, reading an XML document from it" } ;

HELP: file>xml
{ $values { "filename" "a string representing a filename" }
    { "xml" "an XML document" } }
{ $description "opens the given file, reads it in as XML, closes the file and returns the corresponding XML tree" } ;

{ string>xml read-xml file>xml } related-words

HELP: xml>string
{ $values { "xml" "an xml document" } { "string" "a string" } }
{ $description "converts an xml document (" { $link xml } ") into a string" }
{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;

HELP: pprint-xml>string
{ $values { "xml" "an xml document" } { "string" "a string" } }
{ $description "converts an xml document (" { $link xml } ") into a string in a prettyprinted form." }
{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;

HELP: xml-parse-error
{ $class-description "the exception class that all parsing errors in XML documents are in." } ;
