Hi Ephemerality, I've had some great success with you tool. After a bit of help though.
I'm converting my epubs to AZW3 for use on my Paperwhite (1st generation) and every book I run through XRay Builder does not generate the 'chapters' part of the entities file. Perhaps it has something to do with my conversion settings in Calibre or what is in the RAWML file. Here's the relevant section from the RAWML file (I think).
Spoiler:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Table of Contents</title>
<link href="kindle:flow:0003?mime=text/css" rel="stylesheet" type="text/css"/>
</head>
<body id="calibre_generated_inline_toc" aid="1AT9A0">
</body>
</html>
<h2 aid="1AT9A1">Table of Contents</h2>
<ul aid="1AT9A2">
<li aid="1AT9A3"><a href="kindle

os:fid:0000

ff:0000000000" aid="1AT9A4">Dedication</a></li>
<li aid="1AT9A5"><a href="kindle

os:fid:0001

ff:0000000000" aid="1AT9A6">Chapter 1</a></li>
<li aid="1AT9A7"><a href="kindle

os:fid:0002

ff:0000000000" aid="1AT9A8">Chapter 2</a></li>
<li aid="1AT9A9"><a href="kindle

os:fid:0006

ff:0000000000" aid="1AT9AA">Chapter 3</a></li>
<li aid="1AT9AB"><a href="kindle

os:fid:0009

ff:0000000000" aid="1AT9AC">Chapter 4</a></li>
<li aid="1AT9AD"><a href="kindle

os:fid:000D

ff:0000000000" aid="1AT9AE">Chapter 5</a></li>