build functionality for readin xml documents