#+BEGIN_SRC emacs-lisp
(defun get-xml (name)
(save-excursion
(org-babel-goto-named-src-block name)
(org-element-property :value (org-element-context))))
#+END_SRC
#+RESULTS:
: get-xml
like this in a python (or other general lang) block to get the xml as a string that you parse in the language:
#+BEGIN_SRC python :var data=(get-xml "xml-example")
import xml.etree.ElementTree as ET
root = ET.fromstring(data)
for child in root:
print(child.tag, child.attrib)
#+END_SRC
#+RESULTS:
: to {}
: from {}
: heading {}
: body {}