build xml parsing functions