thread based approach for xml processing