Redone the MaterialFactory with jdom so it's not that bad of an hack