I have this c# script for unity that reads a second life genepool xml and creates a gameobject structure suited for later turning into a unity armature, the script works fine and creates it how it needs to be but how do I make a unity armature with the information?

using System;
using System.IO;
using System.Xml;
using UnityEngine;

public class LindenGenepoolImporter : MonoBehaviour
{
    public string xmlFilePath = "Assets/Genepool.xml"; // Set path to your XML file
    public GameObject emptyPrefab; // Assign your Empty_Prefab in the Inspector

    private void Start()
    {
        LoadGenepool(xmlFilePath);
    }

    private void LoadGenepool(string path)
    {
        if (!File.Exists(path))
        {
            Debug.LogError("File not found: " + path);
            return;
        }

        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(path);

        // Find the root bone node (e.g., mPelvis)
        XmlNode rootBoneNode = xmlDoc.SelectSingleNode("//bone[@name='mPelvis']");
        Transform rootTransform = null;

        if (rootBoneNode != null)
        {
            // Create the root GameObject for the pelvis
            rootTransform = CreateBone(rootBoneNode, null);
        }
        else
        {
            Debug.LogError("Root bone 'mPelvis' not found in the XML.");
            return;
        }

        // Load other bones under the rootTransform
        XmlNodeList boneNodes = xmlDoc.SelectNodes("//bone");
        if (boneNodes != null)
        {
            foreach (XmlNode boneNode in boneNodes)
            {
                // Skip the root bone as it's already created
                if (boneNode.Attributes["name"].Value == "mPelvis") continue;

                CreateBone(boneNode, rootTransform);
            }
        }

        // Load parameters (if needed, not detailed in this version)
        XmlNodeList paramNodes = xmlDoc.SelectNodes("//param");
        if (paramNodes != null)
        {
            foreach (XmlNode paramNode in paramNodes)
            {
                // Implement parameter handling if needed
            }
        }
    }

    private Transform CreateBone(XmlNode boneNode, Transform parentTransform)
    {
        string boneName = boneNode.Attributes["name"].Value;
        Vector3 position = ParseVector3(boneNode.Attributes["position"].Value);
        Vector3 scale = ParseVector3(boneNode.Attributes["scale"].Value);

        // Instantiate the cube prefab as a visual representation of the bone
        GameObject bone = Instantiate(emptyPrefab, position, Quaternion.identity);
        bone.name = boneName; // Set the name of the GameObject
        bone.transform.localScale = scale; // Set the scale of the cube

        // Set the parent in the hierarchy
        if (parentTransform != null)
        {
            bone.transform.parent = parentTransform;
        }
        else
        {
            bone.transform.parent = this.transform; // use the script's object context if no parent is found
        }

        return bone.transform; // Return the created transform for possible further structuring
    }

    private Vector3 ParseVector3(string value)
    {
        string[] positions = value.Split(' ');
        return new Vector3(
            float.Parse(positions[0]),
            float.Parse(positions[1]),
            float.Parse(positions[2])
        );
    }
}