What are some alternative methods, besides PHP, for extracting and manipulating XML attributes?

When working with XML attributes in PHP, an alternative method for extracting and manipulating them is to use the SimpleXMLElement class. This class provides a more object-oriented approach to working with XML data, making it easier to access and modify attributes.

// Load the XML data
$xml = '<bookstore>
            <book category="fiction">
                <title>Harry Potter</title>
                <author>J.K. Rowling</author>
            </book>
        </bookstore>';
$xmlElement = new SimpleXMLElement($xml);

// Access and modify the attribute
$category = $xmlElement->book['category'];
echo "Category: " . $category . "\n";

// Modify the attribute value
$xmlElement->book['category'] = 'fantasy';
echo $xmlElement->asXML();