title: R XML - combining parent and child nodes into data frame
body: <p>I have xml like this:</p>
  
  <pre><code>&lt;root&gt;
  &lt;cards&gt;
  &lt;meeting name="Punchestown (IRE)" id="195" diffusion_course_name="PUNCHESTOWN"&gt;
        &lt;race id="692415" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;12:25&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Adare Manor Opportunity Handicap Chase&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;2m4f&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;10&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Handicap Chase&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692416" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;1:00&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Total Event Rental (Kildare) Novice Chase (Grade 3)&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;2m4f&lt;/distance&gt;
          &lt;group&gt;Grade 3&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;7&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Novice Chase Grade 3&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692417" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;1:35&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Connolly's RED MILLS Amateur National (Q.R.) Handicap Chase&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;3m1f&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;12&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Handicap Chase&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692418" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;2:10&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Sky Bet Moscow Flyer Novice Hurdle (Grade 2)&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m&lt;/distance&gt;
          &lt;group&gt;Grade 2&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;7&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Novice Hurdle Grade 2&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692419" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;2:45&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Sportinglife.com Maiden Hurdle&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;17&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Maiden Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692420" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;3:20&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Leinster Leader Mares Handicap Hurdle&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m4f40y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;8&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Handicap Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692421" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;3:50&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;David Trundley Artist At Punchestown Irish Stallion Farms EBF Mares Flat Race&lt;/title&gt;
          &lt;type&gt;B&lt;/type&gt;
          &lt;distance&gt;2m&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;14&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;NHF&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
      &lt;/meeting&gt;
      &lt;meeting name="Warwick" id="85" diffusion_course_name="WARWICK"&gt;
        &lt;race id="691061" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;12:40&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betfred Supports Jack Berry House Novices' Handicap Hurdle&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;18&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Novice Handicap Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;WH&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691060" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;1:15&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betfred Mobile Edward Courage Cup Handicap Chase&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;2m54y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;7&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 3 Handicap Chase&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;LB&lt;/betOffer&gt;
            &lt;betOffer&gt;WH&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691058" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;1:50&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betfred Home Of Goals Galore Hampton Novices' Chase (Listed Race)&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;3m&lt;/distance&gt;
          &lt;group&gt;Listed&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;5&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 1 Novice Chase Listed&lt;/raceDescription&gt;
          &lt;tvText&gt;ITV4 &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;Coral&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691059" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;2:25&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Pertemps Network Handicap Hurdle (Series Qualifier)&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;3m1f&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;12&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 2 Handicap Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;ITV4 &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;LB&lt;/betOffer&gt;
            &lt;betOffer&gt;WH&lt;/betOffer&gt;
            &lt;betOffer&gt;Coral&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691057" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;3:00&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Ballymore Leamington Novices' Hurdle (Grade 2)&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m5f&lt;/distance&gt;
          &lt;group&gt;Grade 2&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;6&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 1 Novice Hurdle Grade 2&lt;/raceDescription&gt;
          &lt;tvText&gt;ITV4 &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;WH&lt;/betOffer&gt;
            &lt;betOffer&gt;Coral&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691056" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;3:35&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betfred Classic Handicap Chase (Grade 3)&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;3m5f54y&lt;/distance&gt;
          &lt;group&gt;Grade 3 Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;15&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 1 Handicap Chase Grade 3&lt;/raceDescription&gt;
          &lt;tvText&gt;ITV4 &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;LB&lt;/betOffer&gt;
            &lt;betOffer&gt;WH&lt;/betOffer&gt;
            &lt;betOffer&gt;Coral&lt;/betOffer&gt;
            &lt;betOffer&gt;PP&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691062" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;4:05&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betfred TV "Newcomers" Standard Open National Hunt Flat Race&lt;/title&gt;
          &lt;type&gt;B&lt;/type&gt;
          &lt;distance&gt;2m&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;9&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 5 NHF&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;WH&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
      &lt;/meeting&gt;
      &lt;meeting name="Wetherby" id="87" diffusion_course_name="WETHERBY"&gt;
        &lt;race id="691067" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;12:30&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Racing UK Jump To It Novices' Hurdle&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m3f154y&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;9&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Novice Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691066" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;1:05&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Racing UK In Stunning HD "Confined" Novices' Chase&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;2m3f85y&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;7&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Novice Chase&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691068" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;1:40&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Bet At racinguk.com Handicap Hurdle&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;9&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Handicap Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691063" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;2:15&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;totescoop6 Play Today Handicap Chase&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;1m7f36y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;5&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 2 Handicap Chase&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691064" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;2:50&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;totescoop6 Results On totepoolliveinfo.com Handicap Hurdle&lt;/title&gt;
          &lt;type&gt;H&lt;/type&gt;
          &lt;distance&gt;2m3f154y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;11&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 3 Handicap Hurdle&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691065" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;3:25&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Book Now For Medieval Day - 3rd February Handicap Chase (Northern Lights Middle Distance Series)&lt;/title&gt;
          &lt;type&gt;C&lt;/type&gt;
          &lt;distance&gt;2m3f85y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;7&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Handicap Chase&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
          &lt;betOffers&gt;
            &lt;betOffer&gt;LB&lt;/betOffer&gt;
          &lt;/betOffers&gt;
        &lt;/race&gt;
        &lt;race id="691069" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;3:55&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Racing UK On Sky 432 Fillies' "Junior" Standard Open National Hunt Flat Race&lt;/title&gt;
          &lt;type&gt;B&lt;/type&gt;
          &lt;distance&gt;1m4f77y&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;8&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 5 NHF&lt;/raceDescription&gt;
          &lt;tvText&gt;RUK &lt;/tvText&gt;
        &lt;/race&gt;
      &lt;/meeting&gt;
      &lt;meeting name="Wolverhampton (AW)" id="513" diffusion_course_name="WOLVERHAMPTON"&gt;
        &lt;race id="691141" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;5:45&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Bet &amp;amp; Watch At sunbets.co.uk Apprentice Handicap&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;1m142y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;13&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 6 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691136" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;6:15&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;sunbets.co.uk Handicap&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;1m142y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;9&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691140" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;6:45&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betway Live Casino Handicap&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;2m120y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;13&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 6 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691138" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;7:15&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betway Casino Handicap (Div I)&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;6f20y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;13&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 5 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="692653" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;7:45&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betway Casino Handicap (Div II)&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;6f20y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;12&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 5 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691139" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;8:15&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;Betway Novice Stakes&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;5f21y&lt;/distance&gt;
          &lt;group/&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;6&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 5 Novice&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691137" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;8:45&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;32Red.com Handicap&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;5f21y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;7&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 4 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
        &lt;race id="691142" perform_race_id="" perform_race_id_atr="" details_available="1" race_status_code="R"&gt;
          &lt;time&gt;9:15&lt;/time&gt;
          &lt;date&gt;2018-01-13&lt;/date&gt;
          &lt;ampm&gt;pm&lt;/ampm&gt;
          &lt;title&gt;32Red Casino Handicap&lt;/title&gt;
          &lt;type&gt;X&lt;/type&gt;
          &lt;distance&gt;1m1f104y&lt;/distance&gt;
          &lt;group&gt;Handicap&lt;/group&gt;
          &lt;tipsAllowed&gt;1&lt;/tipsAllowed&gt;
          &lt;predictorAllowed&gt;1&lt;/predictorAllowed&gt;
          &lt;bettingLink&gt;1&lt;/bettingLink&gt;
          &lt;declaredRunners&gt;11&lt;/declaredRunners&gt;
          &lt;liveCommentary&gt;1&lt;/liveCommentary&gt;
          &lt;liveTab&gt;1&lt;/liveTab&gt;
          &lt;raceDescription&gt;Class 6 Handicap&lt;/raceDescription&gt;
          &lt;tvText&gt;ATR &lt;/tvText&gt;
        &lt;/race&gt;
      &lt;/meeting&gt;
    &lt;/cards&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I can get the data i want which is essentially the race data (child nodes) by running this R code:</p>
  
  <pre><code>CardList=cbind(
    date,
    data.frame(raceid=xpathSApply(CardList_tmp, "//meeting/race", xmlGetAttr, 'id')),
    data.frame(cards=xpathSApply(CardList_tmp, "//meeting/race", xmlGetAttr, 'details_available')),
    data.frame(status=xpathSApply(CardList_tmp, "//meeting/race", xmlGetAttr, 'race_status_code')),
    xmlToDataFrame(nodes = getNodeSet(CardList_tmp, "//meeting/race"))
    )
  </code></pre>
  
  <p>However it doesn't contain the meeting data which is held at the parent attribute level:</p>
  
  <pre><code>course = xpathSApply(CardList_tmp, "//meeting", xmlGetAttr, 'name')
  cid = xpathSApply(CardList_tmp, "//meeting", xmlGetAttr, 'id')
  </code></pre>
  
  <p>Is there a way i can combine the two sets of code together to provide one dataframe and in one step?</p>