Rewritten as into-xml, added docs, test code, etc.