I basically created a temp XML document and put the XML from both files (base and page) into 1, so that I could freely move data around as desired. It got me past that first hurdle.
Ben comments his code very well, but he is far above the level of ColdFusion developer I am. It would be like a grade school math student attending a class in advanced trigonometry. It's only a solution if you can comprehend what he's doing at each stage, and even with his comments, I was not able to follow his solution. It can be as simple as verbage throwing me off; if we're not on the same page, I simply can't follow.
So for example, I have a structure now like this:
(LOCAL.mergedXML):
<root>
<template>
<!-- The base template XML is here. -->
</template>
<pageTemplate>
<!-- The merger template XML is here. -->
</pageTemplate>
</root>
I was successfully able to use arrayAppend() in order to append information from the <pageTemplate> node into the <template> node, but oddly, I am now executing the next command, to prepend data, and when I attempt to do so, ColdFusion is throwing an error. The code it errors on is:
<cfset arrayPrepend( LOCAL.mergedXML.root.template.xmlChildren[ LOCAL.tplVars.matchedIndex ].xmlChildren, LOCAL.tplVars.prependContent ) />
I have verified through isArray() that both values are arrays, but CF returns a: java.lang.ClassCastException error with an empty message value.
As for why I'm building my own template engine, Pablo Picasso once said "I am always doing that which I cannot do, in order that I may learn it". I understand coder's desire not to "reinvent the wheel", however standing on the shoulders of those who came before me may get me to a solution faster, but does not expand my skillsets as a developer.
OK, I figured this one out. Once I figured out how to reference the base XML location, I simply ensured to use the .xmlChildren() function in tandem with the array methods provided by ColdFusion, and that seems to have gotten me to where I want to be. Appreciate the help guys.