moved parts of XML parsing into shared library