Slightly functional XML parsing