lots of xml parsing changes. database added, new code to use it added.