I've just started delving into C# and came into an obstacle. I don't know how to reference materials written down in XML.
you might need to be a bit more specific, are you talking about ThingDef.defName or do you mean the stuff that Things are made of.
if you are looking at what something is made from in the XML tag <stuffCategories>then have a look at
Thing.Stuff
(where Thing is the Thing you are looking at) this gets you the ThingDef of what something is made of (eg Synthread, Jade)
if you want the StuffCategoryDef instead, you can look at
Thing.Stuff.stuffProps.categories
this is a list of StuffCategoryDef (eg Woody, Stony, Fabric) the stuff that the thing is made of belongs to.
what exactly you want?
there is defdatabase class that handle all defs and allows you to read and ever write to database.