It would appear that all your
SubChildNode
s are being added to the first
PNG
node, rather than each one in turn. I have not been able to test this, but perhaps something like:
$ParentNode =$file.Meta["Image"]
for($j=0; $j -lt 10; $j++){
$ChildNode = $file.CreateElement("PNG",$Parent.NamespaceURI)
$ParentNode.AppendChild($ChildNode)
$SubChildNode = $metafile.CreateElement("URL",$ParentNode.NamespaceURI)
$ChildNode.AppendChild($SubChildNode)
}
$metafile.Save("MyFile.xml")