Properties such as firstChild, nextSibling, etc. are read only and should not be changed, although technically it is possible to do so. This was a conscious decision because PHP does not allow the stacking of method calls on a single line like:
$myCD = $cdCollection->getDocumentElement()->getChildNodes(1);
Always modify nodes using appendChild, insertBefore, removeChild, and replaceChild!