more safety, example demo, docs, fix a bunch of xml possible bugs