function prev_child_name($node)
{
    // get the previous child
    $nextNode = $node->previousSibling;
    while (null !== $nextNode) {