Export Format Question

I am looking to extract basic bone structure and pose data for a project I am working on in python.

The ideal format for the data would be a tree like structure (XML preferred), such as:

Model data:

parent bone (name,length)
–child bone(name, length)
----child bone(name, length)

Animation data:

pose1:
angle between “bone1” “bone2” = 45
pose2:
angle between “bone1” “bone2” = 90
etc…

My question is: Are there any formats out there that can be easily parsed so that I can extract this data?

Otherwise, I am willing to write a python script to export this data myself, but I have never done this in blender before. Could someone please point me to a good tutorial for writing scripts to export data in blender?

Thanks,
New to blender

the very nice ogre3d exporter exports to a xml format, for which there are tools to convert to the ogre3d binary .mesh and .skeleton [mesh and animation formats]

the download is on this page:
http://www.ogre3d.org/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=3