migrated to using xml document instead of just xml nodes (to prevent memory issues)