Make it easier to parse directly to XMLS like format.

Added an example to the documentation.

Fixed bug in tree-to-xmls when given a document fragement.