I think I'm approaching this from the wrong direction, so am happy to adapt my workflow, but this is what I'm currently doing: I'm importing XML, which looks like this, into InDesign:
<Story>
<h1>Heading</h1>
<body>
<p>An awesome paragraph.</p>
<p>An even more awesome paragraph.</p>
</body>
<coloredblock>
<h1>Heading for a colored block</h1>
<body>
<p>Paragraph of a colored block.</p>
<p>Another paragraph.</p>
</body>
</coloredblock>
</Story>
I want <coloredblock>
to stay within the text flow (I'm importing all this XML into the document's text frame), but to have a background color, and ideally have some inner padding - essentially, to look like the code block above in comparison with this body text.
Is this achievable? Do I need to make it as a separate text frame? If so, is there a way to make the <coloredblock>
XML import as a separate text frame?