XML firstChild


My XML File looks like this:

<details colour = "blue" />

<page contents = "Insert this text"/>

Now as I understand it, this.firstChild = box
How would I write ??? = news

I know I can put ‘page’ into the ‘box’ Node, but my code is running a for loop with that section of the xml, as it contains numerous ‘details’, so I would like to keep it as above, as I also want to take the information using attributes.contents